1 | <?php |
||
17 | trait Sortable |
||
18 | { |
||
19 | /** |
||
20 | * Append many column sorting to query builder. |
||
21 | * |
||
22 | * @param array $columns |
||
23 | * |
||
24 | * @return $this |
||
25 | */ |
||
26 | 14 | public function multiSortBy(array $columns) |
|
38 | |||
39 | /** |
||
40 | * Append relation column sorting to query builder. |
||
41 | * |
||
42 | * @param array $column |
||
43 | * @param string $direction |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | 2 | public function sortByRelation($column, $direction = 'ASC') |
|
69 | |||
70 | /** |
||
71 | * Add joining the tables to query based on the type of relationship. |
||
72 | * |
||
73 | * @param Relation $relationClass |
||
74 | */ |
||
75 | 2 | protected function joinRelation(Relation $relationClass) |
|
92 | |||
93 | /** |
||
94 | * Join a belongs to many relationship. |
||
95 | * |
||
96 | * @param BelongsToMany $relation |
||
97 | * |
||
98 | * @return mixed |
||
99 | */ |
||
100 | protected function joinBelongsToMany(BelongsToMany $relation) |
||
108 | |||
109 | /** |
||
110 | * Join a belongs to relationship. |
||
111 | * |
||
112 | * @param BelongsTo $relation |
||
113 | * |
||
114 | * @return mixed |
||
115 | */ |
||
116 | protected function joinBelongsTo(BelongsTo $relation) |
||
121 | |||
122 | /** |
||
123 | * Join a has one relationship. |
||
124 | * |
||
125 | * @param HasOneOrMany $relation |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | protected function joinHasOne(HasOneOrMany $relation) |
||
135 | |||
136 | /** |
||
137 | * Append column sorting to query builder. |
||
138 | * |
||
139 | * @param string|array $column |
||
140 | * @param string $direction |
||
141 | * |
||
142 | * @return $this |
||
143 | */ |
||
144 | 2 | public function sortBy($column, $direction = 'ASC') |
|
150 | } |
||
151 |
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: