1 | <?php |
||
32 | class Query implements \IteratorAggregate |
||
33 | { |
||
34 | use Macroable { |
||
35 | Macroable::__call as __macroableCall; |
||
36 | Macroable::__callStatic as __macroableCallStatic; |
||
37 | } |
||
38 | |||
39 | use ModeProvider; |
||
40 | use AliasProvider; |
||
41 | use WhereProvider; |
||
42 | use OrderProvider; |
||
43 | use SelectProvider; |
||
44 | use GroupByProvider; |
||
45 | use RelationProvider; |
||
46 | use RepositoryProvider; |
||
47 | use ExecutionsProvider; |
||
48 | use LimitAndOffsetProvider; |
||
49 | |||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | private static $booted = false; |
||
54 | |||
55 | /** |
||
56 | * @var CriterionInterface[]|\SplDoublyLinkedList |
||
57 | */ |
||
58 | protected $criteria; |
||
59 | |||
60 | /** |
||
61 | * @var array|ObjectRepository[] |
||
62 | */ |
||
63 | protected $scopes = []; |
||
64 | |||
65 | /** |
||
66 | * Query constructor. |
||
67 | * @param ObjectRepository|null $repository |
||
68 | */ |
||
69 | 67 | public function __construct(ObjectRepository $repository = null) |
|
77 | |||
78 | /** |
||
79 | * @param string $stmt |
||
80 | * @return string |
||
81 | */ |
||
82 | public static function raw(string $stmt): string |
||
86 | |||
87 | /** |
||
88 | * @param string $method |
||
89 | * @param array $parameters |
||
90 | * @return mixed |
||
91 | */ |
||
92 | public static function __callStatic(string $method, array $parameters = []) |
||
98 | |||
99 | /** |
||
100 | * @param string $criterion |
||
101 | * @return bool |
||
102 | */ |
||
103 | 20 | public function has(string $criterion): bool |
|
113 | |||
114 | /** |
||
115 | * @param string $name |
||
116 | * @return null |
||
117 | */ |
||
118 | 19 | public function __get(string $name) |
|
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getClassName(): string |
||
134 | |||
135 | /** |
||
136 | * @return EntityManagerInterface |
||
137 | */ |
||
138 | public function getEntityManager(): EntityManagerInterface |
||
142 | |||
143 | /** |
||
144 | * @return ClassMetadata |
||
145 | */ |
||
146 | public function getMetadata(): ClassMetadata |
||
150 | |||
151 | /** |
||
152 | * @param string $name |
||
153 | * @return string |
||
154 | */ |
||
155 | public function column(string $name): string |
||
162 | |||
163 | /** |
||
164 | * @param string $method |
||
165 | * @param array $parameters |
||
166 | * @return mixed|$this|Query |
||
167 | */ |
||
168 | 4 | public function __call(string $method, array $parameters = []) |
|
183 | |||
184 | /** |
||
185 | * Returns a list of selection criteria. |
||
186 | * |
||
187 | * @return \Generator|CriterionInterface[] |
||
188 | */ |
||
189 | 67 | public function getCriteria(): \Generator |
|
193 | |||
194 | /** |
||
195 | * Creates a new query (alias to the constructor). |
||
196 | * |
||
197 | * @param CriterionInterface $criterion |
||
198 | * @return Query|$this |
||
199 | */ |
||
200 | 65 | public function add(CriterionInterface $criterion): self |
|
210 | |||
211 | /** |
||
212 | * Creates a new query using the current set of scopes. |
||
213 | * |
||
214 | * @return Query |
||
215 | */ |
||
216 | 5 | public function create(): Query |
|
226 | |||
227 | /** |
||
228 | * Adds the specified set of scopes (method groups) to the query. |
||
229 | * |
||
230 | * @param object|string ...$scopes |
||
231 | * @return Query|$this |
||
232 | */ |
||
233 | 33 | public function scope(...$scopes): self |
|
239 | |||
240 | /** |
||
241 | * Creates a new query (alias to the constructor). |
||
242 | * |
||
243 | * @param ObjectRepository|null $repository |
||
244 | * @return Query |
||
245 | */ |
||
246 | 67 | public static function new(ObjectRepository $repository = null): Query |
|
250 | |||
251 | /** |
||
252 | * Returns a set of scopes for the specified query. |
||
253 | * |
||
254 | * @return array|ObjectRepository[] |
||
255 | */ |
||
256 | 5 | public function getScopes(): array |
|
260 | |||
261 | /** |
||
262 | * Copies a set of Criteria from the child query to the parent. |
||
263 | * |
||
264 | * @param Query $query |
||
265 | * @return Query |
||
266 | */ |
||
267 | 4 | public function merge(Query $query): Query |
|
275 | |||
276 | /** |
||
277 | * @param Query $query |
||
278 | * @return Query |
||
279 | */ |
||
280 | 4 | public function attach(Query $query): Query |
|
288 | |||
289 | /** |
||
290 | * @return void |
||
291 | */ |
||
292 | 4 | public function __clone() |
|
305 | |||
306 | /** |
||
307 | * @return \Generator |
||
308 | */ |
||
309 | public function getIterator(): \Generator |
||
315 | |||
316 | /** |
||
317 | * @return bool |
||
318 | */ |
||
319 | public function isEmpty(): bool |
||
323 | |||
324 | /** |
||
325 | * @return void |
||
326 | */ |
||
327 | 30 | private function bootIfNotBooted(): void |
|
336 | |||
337 | /** |
||
338 | * @return string |
||
339 | */ |
||
340 | public function dump(): string |
||
344 | } |
||
345 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: