1 | <?php |
||
16 | class TableGateway extends AbstractDataSource |
||
17 | { |
||
18 | /** |
||
19 | * @var ZendTableGateway |
||
20 | */ |
||
21 | protected $tableGateway; |
||
22 | |||
23 | /** |
||
24 | * @var Select |
||
25 | */ |
||
26 | protected $select; |
||
27 | |||
28 | /** |
||
29 | * Base table columns |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $tableColumns = []; |
||
34 | |||
35 | /** |
||
36 | * Joined tables |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $joinedTables = []; |
||
41 | |||
42 | /** |
||
43 | * Joined table columns |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $joinedColumns = []; |
||
48 | |||
49 | /** |
||
50 | * @param ZendTableGateway $tableGateway |
||
51 | */ |
||
52 | public function __construct(ZendTableGateway $tableGateway) |
||
60 | |||
61 | /** |
||
62 | * @return Select |
||
63 | */ |
||
64 | public function getSelect() |
||
68 | |||
69 | /** |
||
70 | * Join other table and collect joined columns |
||
71 | * |
||
72 | * @param $joinedTableName |
||
73 | * @param $alias |
||
74 | * @param $keyName |
||
75 | * @param $foreignKeyName |
||
76 | * @param null $columns |
||
77 | */ |
||
78 | public function with($joinedTableName, $alias, $keyName, $foreignKeyName, $columns = null) |
||
104 | |||
105 | /** |
||
106 | * @return array |
||
107 | */ |
||
108 | public function loadColumns() |
||
157 | |||
158 | /** |
||
159 | * @param $columns |
||
160 | */ |
||
161 | protected function setCommentAsLabel($columns) |
||
175 | |||
176 | /** |
||
177 | * @param $order ['field1' => 'direction1', 'field2' => 'direction2'] |
||
178 | * @param array $filters |
||
179 | * @return $this |
||
180 | * @throws \Exception |
||
181 | */ |
||
182 | public function prepare($order = [], $filters = []) |
||
209 | |||
210 | /** |
||
211 | * Return row by identifier (primary key) |
||
212 | * |
||
213 | * @param $key |
||
214 | * @return array|mixed |
||
215 | */ |
||
216 | public function find($key) |
||
220 | |||
221 | /** |
||
222 | * Get only fields which present in table |
||
223 | * |
||
224 | * @param array $data |
||
225 | * @return array |
||
226 | */ |
||
227 | protected function cleanDataForSql($data = []) |
||
238 | |||
239 | /** |
||
240 | * @param $data |
||
241 | * @return int|mixed |
||
242 | */ |
||
243 | public function insert($data) |
||
248 | |||
249 | /** |
||
250 | * @param $data |
||
251 | * @param $key |
||
252 | * @return int|mixed |
||
253 | */ |
||
254 | public function update($data, $key) |
||
258 | |||
259 | /** |
||
260 | * @param $key |
||
261 | * @return int|mixed |
||
262 | */ |
||
263 | public function delete($key) |
||
267 | |||
268 | /** |
||
269 | * @return Adapter|\Zend\Db\Adapter\AdapterInterface |
||
270 | */ |
||
271 | protected function getDbAdapter() |
||
275 | |||
276 | /** |
||
277 | * @return DbSelectPaginatorAdapter |
||
278 | */ |
||
279 | public function getPaginatorAdapter() |
||
283 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.