1 | <?php namespace Anomaly\Streams\Platform\Entry; |
||
14 | class EntryCriteria extends EloquentCriteria |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * The stream instance. |
||
19 | * |
||
20 | * @var StreamInterface |
||
21 | */ |
||
22 | protected $stream; |
||
23 | |||
24 | /** |
||
25 | * Create a new EntryCriteria instance. |
||
26 | * |
||
27 | * @param Builder $query |
||
28 | * @param StreamInterface $stream |
||
29 | * @param string $method |
||
30 | */ |
||
31 | public function __construct(Builder $query, StreamInterface $stream, $method) |
||
37 | |||
38 | /** |
||
39 | * Return sorted entries. |
||
40 | * |
||
41 | * @param string $direction |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function sorted($direction = 'ASC') |
||
45 | { |
||
46 | $this->query->orderBy('sort_order', $direction); |
||
|
|||
47 | |||
48 | return $this; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Route through __call. |
||
53 | * |
||
54 | * @param $name |
||
55 | * @return Builder|null |
||
56 | */ |
||
57 | public function __get($name) |
||
67 | |||
68 | /** |
||
69 | * Call the method on the query. |
||
70 | * |
||
71 | * @param $name |
||
72 | * @param $arguments |
||
73 | * @return Builder|null |
||
74 | */ |
||
75 | public function __call($name, $arguments) |
||
85 | } |
||
86 |
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: