1 | <?php |
||
21 | class EntityQuery extends Generic |
||
22 | { |
||
23 | /** @var array Collection of all additional fields names */ |
||
24 | protected static $fieldNames = array(); |
||
25 | |||
26 | /** @var array Collection of localized additional fields identifiers */ |
||
27 | protected static $localizedFieldIDs = array(); |
||
28 | |||
29 | /** @var array Collection of NOT localized additional fields identifiers */ |
||
30 | protected static $notLocalizedFieldIDs = array(); |
||
31 | |||
32 | /** @var array Collection of all additional fields identifiers */ |
||
33 | protected static $fieldIDs = array(); |
||
34 | |||
35 | /** @var @var array Collection of additional fields value column names */ |
||
36 | protected static $fieldValueColumns = array(); |
||
37 | |||
38 | /** @var array Collection of entity field filter */ |
||
39 | protected $fieldFilter = array(); |
||
40 | |||
41 | /** @var string Query locale */ |
||
42 | protected $locale = ''; |
||
43 | |||
44 | /** |
||
45 | * Select specified entity fields. |
||
46 | * If this method is called then only selected entity fields |
||
47 | * would be return in entity instances. |
||
48 | * |
||
49 | * @param mixed $fieldNames Entity field name or collection of names |
||
50 | * @return self Chaining |
||
51 | */ |
||
52 | public function select($fieldNames) |
||
66 | |||
67 | /** |
||
68 | * Add condition to current query. |
||
69 | * |
||
70 | * @param string $fieldName Entity field name |
||
71 | * @param string $fieldValue Value |
||
72 | * @return self Chaining |
||
73 | */ |
||
74 | public function where($fieldName, $fieldValue = null, $fieldRelation = ArgumentInterface::EQUAL) |
||
87 | |||
88 | /** @return array Collection of entity identifiers */ |
||
89 | protected function findEntityIDs() |
||
97 | |||
98 | /** |
||
99 | * Get collection of entity identifiers filtered by navigation identifiers. |
||
100 | * |
||
101 | * @param array $entityIDs Additional collection of entity identifiers for filtering |
||
102 | * @return array Collection of material identifiers by navigation identifiers |
||
103 | */ |
||
104 | protected function findByNavigationIDs($entityIDs = array()) |
||
108 | |||
109 | /** |
||
110 | * Get collection of entity identifiers filtered by additional field and its value. |
||
111 | * |
||
112 | * @param array $additionalFields Collection of additional field identifiers => values |
||
113 | * @param array $entityIDs Additional collection of entity identifiers for filtering |
||
114 | * @return array Collection of material identifiers by navigation identifiers |
||
115 | */ |
||
116 | protected function findByAdditionalFields($additionalFields, $entityIDs = array()) |
||
136 | |||
137 | /** |
||
138 | * Get entities additional field values. |
||
139 | * |
||
140 | * @param array $entityIDs Collection of entity identifiers |
||
141 | * @return array Collection of entities additional fields EntityID => [Additional field name => Value] |
||
142 | */ |
||
143 | protected function findAdditionalFields($entityIDs) |
||
200 | |||
201 | /** |
||
202 | * Perform SamsonCMS query and get collection of entities. |
||
203 | * |
||
204 | * @return \samsoncms\api\Entity[] Collection of entity fields |
||
205 | */ |
||
206 | public function find() |
||
238 | |||
239 | /** |
||
240 | * Perform SamsonCMS query and get first matching entity. |
||
241 | * |
||
242 | * @return \samsoncms\api\Entity Firt matching entity |
||
243 | */ |
||
244 | public function first() |
||
255 | |||
256 | /** |
||
257 | * Perform SamsonCMS query and get collection of entities fields. |
||
258 | * |
||
259 | * @param string $fieldName Entity field name |
||
260 | * @return array Collection of entity fields |
||
261 | * @throws EntityFieldNotFound |
||
262 | */ |
||
263 | public function fields($fieldName) |
||
284 | |||
285 | /** |
||
286 | * Generic constructor. |
||
287 | * |
||
288 | * @param QueryInterface $query Database query instance |
||
289 | * @param string $locale Query localizaation |
||
290 | */ |
||
291 | public function __construct(QueryInterface $query, $locale = '') |
||
297 | } |
||
298 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: