Overview

Namespaces

  • Budovy
  • Kdyby
    • BootstrapFormRenderer
      • DI
      • Latte
  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • Nextras
    • Datagrid
  • None
  • PHP
  • Tester
    • CodeCoverage
    • Runner
      • Output
  • Vodacek
    • Forms
      • Controls
  • WebLoader
    • Filter
    • Nette

Classes

  • AuthorizeScheduledTaskFactory
  • AuthorizeScheduledTaskPresenter
  • BasePresenter
  • BreakdownFactory
  • BreakdownPresenter
  • BreakdownRepository
  • BreakdownStatisticFactory
  • BreakdownStatisticPresenter
  • ContactBindingFactory
  • ContactbindingPresenter
  • ContactBindingRepository
  • ContactFactory
  • ContactPresenter
  • ContactRepository
  • DocumentFactory
  • DocumentPresenter
  • DocumentRepository
  • DocumentsDatagrid
  • DocumenttypeFactory
  • DocumenttypePresenter
  • DocumenttypeRepository
  • DownloadPresenter
  • EmailPresenter
  • ErrorPresenter
  • HomepagePresenter
  • OperationFactory
  • OperationPresenter
  • OperationRepository
  • PeriodicTaskFactory
  • PeriodicTaskPresenter
  • PeriodicTaskRealizationFactory
  • PeriodicTaskRealizationPresenter
  • PeriodicTaskRealizationRepository
  • PeriodicTaskRepository
  • PeriodicTaskStatisticFactory
  • PeriodicTaskStatisticPresenter
  • PlaceFactory
  • PlacePresenter
  • PlaceRepository
  • PriorityFactory
  • PriorityPresenter
  • PriorityRepository
  • Repository
  • RoleRepository
  • RouterFactory
  • ScheduledTaskFactory
  • ScheduledTaskPresenter
  • ScheduledTaskRealizationFactory
  • ScheduledTaskRealizationPresenter
  • ScheduledTaskRealizationRepository
  • ScheduledTaskRepository
  • ScheduledTaskStatisticFactory
  • ScheduledTaskStatisticPresenter
  • SignPresenter
  • UnitFactory
  • UnitPresenter
  • UnitRepository
  • UserFactory
  • UserManager
  • UserPresenter
  • UserRepository
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Budovy;
 3: 
 4: use Nette;
 5: 
 6: abstract class Repository extends Nette\Object {
 7:     /** @var Nette\Database\Connection */
 8:     protected $connection;
 9: 
10:     /** @var Nette\Database\Table\Selection */
11:     protected $table;
12: 
13:     public function __construct(Nette\Database\Table\Selection $table, Nette\Database\Context $db) {
14:         $this->table = $table;
15:         $this->connection = $db;
16:     }
17: 
18:     /**
19:      * Vrací objekt reprezentující databázovou tabulku.
20:      *
21:      * @return Nette\Database\Table\Selection
22:      */
23:     protected function getTable() {
24:         return clone $this->table;
25:     }
26: 
27:     /**
28:      * Vrací řádky podle filtru, např. array('name' => 'John').
29:      *
30:      * @return Nette\Database\Table\Selection
31:      */
32:     public function findBy(array $by) {
33:         return $this->getTable()->where($by);
34:     }
35: 
36:     /**
37:      * Vrací řádek podle primárního klíče.
38:      *
39:      * @return Nette\Database\Table\ActiveRow
40:      */
41: 
42:     public function findById($id) {
43:         return $this->getTable()->get($id);
44:     }
45: 
46:     /**
47:      * Smaže řádek podle primárního klíče.
48:      *
49:      * @return int
50:      */
51: 
52:     public function deleteById($id) {
53:         return $this->getTable()->get($id)->delete();
54:     }
55: 
56:     /**
57:      * Update řádku podle primárního klíče.
58:      *
59:      * @return int
60:      */
61: 
62:     public function updateById($id, $data) {
63:         return $this->getTable()->wherePrimary($id)->update($data);
64:     }
65: 
66:     /**
67:      * Vloží řádek.
68:      *
69:      * @return Nette\Database\Table\ActiveRow
70:      */
71: 
72:     public function insertData($data) {
73:         return $this->getTable()->insert($data);
74:     }
75: }
API documentation generated by ApiGen 2.8.0