1 | <?php |
||
16 | class Model extends \CI_Model |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $criteria = array(); |
||
22 | |||
23 | /** |
||
24 | * Initializes the model instance. |
||
25 | */ |
||
26 | public function __construct() |
||
30 | |||
31 | /** |
||
32 | * Returns all of the models from the database. |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | public function all() |
||
40 | |||
41 | /** |
||
42 | * Returns a total rows from the specified table. |
||
43 | * |
||
44 | * @return integer |
||
45 | */ |
||
46 | public function countAll() |
||
60 | |||
61 | /** |
||
62 | * Deletes the specified ID of the model from the database. |
||
63 | * |
||
64 | * @param integer $id |
||
65 | * @return void |
||
66 | */ |
||
67 | public function delete($id) |
||
75 | |||
76 | /** |
||
77 | * Finds an entity by its primary key / identifier. |
||
78 | * |
||
79 | * @param mixed $id |
||
80 | * @param integer|null $mode |
||
81 | * @param integer|null $version |
||
82 | * @return mixed |
||
83 | */ |
||
84 | public function find($id, $mode = null, $version = null) |
||
90 | |||
91 | /** |
||
92 | * Finds models by a set of criteria. |
||
93 | * |
||
94 | * @param array $criteria |
||
95 | * @param array|null $order |
||
96 | * @param integer|null $limit |
||
97 | * @param integer|null $offset |
||
98 | * @return array |
||
99 | */ |
||
100 | public function findBy(array $criteria, array $order = null, $limit = null, $offset = null) |
||
104 | |||
105 | /** |
||
106 | * Returns an array of rows from a specified entity. |
||
107 | * |
||
108 | * @param string $entity |
||
|
|||
109 | * @param integer|null $limit |
||
110 | * @param integer|null $page |
||
111 | * @param array|null $order |
||
112 | * @return mixed |
||
113 | */ |
||
114 | public function get($limit = null, $page = null, array $order = null) |
||
122 | |||
123 | /** |
||
124 | * Sets the "WHERE" criteria. |
||
125 | * |
||
126 | * @param array|string $key |
||
127 | * @param mixed|null $value |
||
128 | * @return self |
||
129 | */ |
||
130 | public function where($key, $value = null) |
||
140 | |||
141 | /** |
||
142 | * Inserts a new row into the table. |
||
143 | * |
||
144 | * @param array $data |
||
145 | * @return integer |
||
146 | */ |
||
147 | public function insert(array $data) |
||
157 | |||
158 | /** |
||
159 | * Updates the selected row from the table. |
||
160 | * |
||
161 | * @param integer $id |
||
162 | * @param array $data |
||
163 | * @return boolean |
||
164 | */ |
||
165 | public function update($id, array $data) |
||
179 | |||
180 | /** |
||
181 | * Returns the primary key. |
||
182 | * |
||
183 | * @return string |
||
184 | */ |
||
185 | public function primary() |
||
189 | |||
190 | /** |
||
191 | * Returns the name of the table. |
||
192 | * |
||
193 | * @return string |
||
194 | */ |
||
195 | public function table() |
||
199 | |||
200 | /** |
||
201 | * Returns the metadata of an entity. |
||
202 | * |
||
203 | * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata |
||
204 | */ |
||
205 | protected function metadata() |
||
215 | |||
216 | /** |
||
217 | * Calls methods in underscore case. |
||
218 | * |
||
219 | * @param string $method |
||
220 | * @param mixed $parameters |
||
221 | * @return mixed |
||
222 | */ |
||
223 | public function __call($method, $parameters) |
||
227 | } |
||
228 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.