1 | <?php |
||
26 | class Table extends AbstractCrud |
||
27 | { |
||
28 | /** |
||
29 | * @var \Bluz\Db\Table instance of Db\Table |
||
30 | */ |
||
31 | protected $table; |
||
32 | |||
33 | /** |
||
34 | * Setup Table instance |
||
35 | * |
||
36 | * @param Db\Table $table |
||
37 | * |
||
38 | * @return self |
||
39 | */ |
||
40 | 12 | public function setTable(Db\Table $table) |
|
45 | |||
46 | /** |
||
47 | * Return table instance for manipulation |
||
48 | * |
||
49 | * @return Db\Table |
||
50 | * @throws ApplicationException |
||
51 | */ |
||
52 | 18 | public function getTable() |
|
72 | |||
73 | /** |
||
74 | * Get primary key |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | 9 | public function getPrimaryKey() |
|
82 | |||
83 | /** |
||
84 | * Get record from Db or create new object |
||
85 | * |
||
86 | * @param mixed $primary |
||
87 | * |
||
88 | * @return Row |
||
89 | * @throws NotFoundException |
||
90 | */ |
||
91 | 3 | public function readOne($primary) |
|
105 | |||
106 | /** |
||
107 | * Get set of records |
||
108 | * |
||
109 | * @param int $offset |
||
110 | * @param int $limit |
||
111 | * @param array $params |
||
112 | * @param int $total |
||
113 | * |
||
114 | * @return array|int|mixed |
||
115 | * @throws ApplicationException |
||
116 | */ |
||
117 | 1 | public function readSet($offset = 0, $limit = 10, $params = [], &$total = null) |
|
155 | |||
156 | /** |
||
157 | * Create item |
||
158 | * |
||
159 | * @param array $data |
||
160 | * |
||
161 | * @return integer |
||
162 | */ |
||
163 | 1 | public function createOne($data) |
|
169 | |||
170 | /** |
||
171 | * Update item |
||
172 | * |
||
173 | * @param mixed $primary |
||
174 | * @param array $data |
||
175 | * |
||
176 | * @return integer |
||
177 | * @throws NotFoundException |
||
178 | */ |
||
179 | 2 | public function updateOne($primary, $data) |
|
190 | |||
191 | /** |
||
192 | * Delete item |
||
193 | * |
||
194 | * @param mixed $primary |
||
195 | * |
||
196 | * @return integer |
||
197 | * @throws NotFoundException |
||
198 | */ |
||
199 | 2 | public function deleteOne($primary) |
|
208 | } |
||
209 |