1 | <?php |
||
19 | trait Sortable |
||
20 | { |
||
21 | /** |
||
22 | * Append many column sorting to query builder. |
||
23 | * |
||
24 | * @param array $columns |
||
25 | * |
||
26 | * @return $this |
||
27 | */ |
||
28 | 16 | public function multiSortBy(array $columns) |
|
40 | |||
41 | /** |
||
42 | * Append relation column sorting to query builder. |
||
43 | * |
||
44 | * @param array $column |
||
45 | * @param string $direction |
||
46 | * |
||
47 | * @return $this |
||
48 | */ |
||
49 | 2 | public function sortByRelation($column, $direction = 'ASC') |
|
71 | |||
72 | /** |
||
73 | * Add joining the tables to query based on the type of relationship. |
||
74 | * |
||
75 | * @param Relation $relationClass |
||
76 | * |
||
77 | * @return $this |
||
78 | */ |
||
79 | 2 | protected function joinRelation(Relation $relationClass) |
|
97 | |||
98 | /** |
||
99 | * Join a belongs to many relationship. |
||
100 | * |
||
101 | * @param BelongsToMany $relation |
||
102 | * |
||
103 | * @return mixed |
||
104 | */ |
||
105 | protected function joinBelongsToMany(BelongsToMany $relation) |
||
119 | |||
120 | /** |
||
121 | * Join a belongs to relationship. |
||
122 | * |
||
123 | * @param BelongsTo $relation |
||
124 | * |
||
125 | * @return mixed |
||
126 | */ |
||
127 | 2 | protected function joinBelongsTo(BelongsTo $relation) |
|
136 | |||
137 | /** |
||
138 | * Join a has one relationship. |
||
139 | * |
||
140 | * @param HasOneOrMany $relation |
||
141 | * |
||
142 | * @return mixed |
||
143 | */ |
||
144 | 2 | protected function joinHasOneOrMany(HasOneOrMany $relation) |
|
153 | |||
154 | /** |
||
155 | * Append column sorting to query builder. |
||
156 | * |
||
157 | * @param string|array $column |
||
158 | * @param string $direction |
||
159 | * |
||
160 | * @return $this |
||
161 | */ |
||
162 | 2 | public function sortBy($column, $direction = 'ASC') |
|
168 | } |
||
169 |
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: