1 | <?php |
||
46 | class Finder |
||
47 | { |
||
48 | /** |
||
49 | * Results |
||
50 | * |
||
51 | * @var array |
||
52 | */ |
||
53 | protected $resultSet; |
||
54 | |||
55 | /** |
||
56 | * Table to navigate |
||
57 | * |
||
58 | * @var Table |
||
59 | */ |
||
60 | protected $table; |
||
61 | |||
62 | /** |
||
63 | * Current Connection |
||
64 | * |
||
65 | * @var Connection |
||
66 | */ |
||
67 | protected $connection; |
||
68 | |||
69 | /** |
||
70 | * Current query |
||
71 | * |
||
72 | * @var Query |
||
73 | */ |
||
74 | protected $query; |
||
75 | |||
76 | /** |
||
77 | * Query parameters |
||
78 | * |
||
79 | * @var array |
||
80 | */ |
||
81 | protected $params; |
||
82 | |||
83 | /** |
||
84 | * Entity class name |
||
85 | * |
||
86 | * @var string |
||
87 | */ |
||
88 | protected $entity; |
||
89 | |||
90 | /** |
||
91 | * List of entity listeners |
||
92 | * |
||
93 | * @array |
||
94 | */ |
||
95 | protected $listeners; |
||
96 | |||
97 | /** |
||
98 | * Constructor |
||
99 | * |
||
100 | * @param Table $table Main table to query |
||
101 | * @param Connection $connection Actual Connection |
||
|
|||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | public function __construct(Table $table, Connection $connection = null) |
||
124 | |||
125 | /** |
||
126 | * Defines a connection |
||
127 | * |
||
128 | * @param Connection $connection Actual Connection |
||
129 | * |
||
130 | * @return Finder |
||
131 | */ |
||
132 | public function setConnection(Connection $connection) |
||
138 | |||
139 | /** |
||
140 | * Returns current connection |
||
141 | * |
||
142 | * @throws Exception if no connection is defined |
||
143 | * @return Connection |
||
144 | */ |
||
145 | public function getConnection() |
||
153 | |||
154 | /** |
||
155 | * Find one or more results according to the list of $identifiers. |
||
156 | * |
||
157 | * @param array $identifiers List of columns to search |
||
158 | * |
||
159 | * @throws Exception if Query already done |
||
160 | * @return array |
||
161 | */ |
||
162 | public function find(array $identifiers) |
||
178 | |||
179 | /** |
||
180 | * Finds one entry according to identifiers. |
||
181 | * |
||
182 | * @param mixed $identifiers List of/single identifiers |
||
183 | * |
||
184 | * @throws Exception if Query already done |
||
185 | * @return mixed |
||
186 | */ |
||
187 | public function one($identifiers) |
||
223 | |||
224 | /** |
||
225 | * Fetches all entries from the table |
||
226 | * |
||
227 | * @return array |
||
228 | */ |
||
229 | public function all() |
||
235 | |||
236 | /** |
||
237 | * Executes the query (if required) and returns the result set. |
||
238 | * |
||
239 | * @return array |
||
240 | */ |
||
241 | public function getResultSet() |
||
252 | |||
253 | /** |
||
254 | * Entity class name |
||
255 | * |
||
256 | * @return string |
||
257 | */ |
||
258 | public function getEntity() |
||
262 | |||
263 | /** |
||
264 | * List of entity listeners |
||
265 | * |
||
266 | * @return array |
||
267 | */ |
||
268 | public function getListeners() |
||
272 | |||
273 | /** |
||
274 | * Defines the entity that should be returned by this Finder |
||
275 | * |
||
276 | * @param string $entity The entity class name |
||
277 | * @param array $listeners List of listeners to be used with this entity |
||
278 | * (table defaults are overriden) |
||
279 | * |
||
280 | * @return Finder |
||
281 | */ |
||
282 | public function setEntity($entity, array $listeners = array()) |
||
289 | } |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.