1 | <?php |
||
28 | 1 | class NetteDatabase implements IDataSource |
|
29 | { |
||
30 | use \Nette\SmartObject; |
||
31 | |||
32 | /** @var \Nette\Database\Table\Selection */ |
||
33 | protected $selection; |
||
34 | |||
35 | /** |
||
36 | * @param \Nette\Database\Table\Selection $selection |
||
37 | */ |
||
38 | 1 | public function __construct(\Nette\Database\Table\Selection $selection) |
|
42 | |||
43 | /** |
||
44 | * @return \Nette\Database\Table\Selection |
||
45 | 1 | */ |
|
46 | 1 | public function getSelection() |
|
50 | |||
51 | /** |
||
52 | * @param Condition $condition |
||
53 | * @param \Nette\Database\Table\Selection $selection |
||
54 | */ |
||
55 | protected function makeWhere(Condition $condition, \Nette\Database\Table\Selection $selection = NULL) |
||
67 | |||
68 | /********************************** inline editation helpers ************************************/ |
||
69 | |||
70 | /** |
||
71 | * Default callback for an inline editation save. |
||
72 | * @param mixed $id |
||
73 | * @param array $values |
||
74 | * @param string $idCol |
||
75 | * @return bool |
||
76 | */ |
||
77 | 1 | public function update($id, array $values, $idCol) |
|
83 | |||
84 | /** |
||
85 | * Default callback used when an editable column has customRender. |
||
86 | * @param mixed $id |
||
87 | * @param string $idCol |
||
88 | * @return \Nette\Database\Table\ActiveRow|bool |
||
89 | */ |
||
90 | public function getRow($id, $idCol) |
||
96 | |||
97 | /********************************** interface IDataSource ************************************/ |
||
98 | |||
99 | /** |
||
100 | * @return int |
||
101 | */ |
||
102 | 1 | public function getCount() |
|
106 | |||
107 | /** |
||
108 | * @return array |
||
109 | */ |
||
110 | 1 | public function getData() |
|
114 | |||
115 | /** |
||
116 | * @param array $conditions |
||
117 | */ |
||
118 | 1 | public function filter(array $conditions) |
|
124 | |||
125 | /** |
||
126 | * @param int $offset |
||
127 | * @param int $limit |
||
128 | */ |
||
129 | 1 | public function limit($offset, $limit) |
|
133 | |||
134 | /** |
||
135 | * @param array $sorting |
||
136 | */ |
||
137 | 1 | public function sort(array $sorting) |
|
143 | |||
144 | /** |
||
145 | * @param mixed $column |
||
146 | * @param array $conditions |
||
147 | * @param int $limit |
||
148 | * @return array |
||
149 | * @throws Exception |
||
150 | */ |
||
151 | 1 | public function suggest($column, array $conditions, $limit) |
|
178 | } |
||
179 |