1 | <?php |
||
22 | abstract class Model implements Arrayable, Jsonable, Stringable, JsonSerializable |
||
23 | { |
||
24 | use Presentable, Eventable, Mergeable; |
||
25 | use Idable, Userable, Timestampable; |
||
26 | use Fillable, Cacheable; |
||
27 | |||
28 | /** |
||
29 | * @var IDAL |
||
30 | */ |
||
31 | public $_dal; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | public $_exist = false; |
||
37 | |||
38 | /** |
||
39 | * Create a new instance. |
||
40 | * |
||
41 | * @param IDAL $dal |
||
42 | * @param array $attributes |
||
43 | */ |
||
44 | 52 | public function __construct(IDAL $dal, array $attributes = []) |
|
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function toArray() |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function jsonSerialize() |
||
68 | |||
69 | /** |
||
70 | * Save the model. |
||
71 | * |
||
72 | * @param array $columns |
||
73 | * @return bool |
||
74 | */ |
||
75 | 24 | public function save($columns = ['*']) |
|
97 | |||
98 | /** |
||
99 | * Delete the model. |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | 6 | public function delete() |
|
122 | |||
123 | /** |
||
124 | * Create a new instance. |
||
125 | * |
||
126 | * @return static |
||
127 | */ |
||
128 | public static function createInstance() |
||
132 | |||
133 | /** |
||
134 | * Find a model by its primary key. |
||
135 | * |
||
136 | * @param mixed $id |
||
137 | * @param array $columns |
||
138 | * @param array $options |
||
139 | * @return static |
||
140 | */ |
||
141 | 22 | public static function find($id, array $columns = ['*'], $options = []) |
|
174 | |||
175 | /** |
||
176 | * Find a model by its primary key or return new model. |
||
177 | * |
||
178 | * @param mixed $id |
||
179 | * @return static |
||
180 | */ |
||
181 | 2 | public static function findOrNew($id) |
|
190 | |||
191 | /** |
||
192 | * Find a model by its primary key or throw an exception. |
||
193 | * |
||
194 | * @param mixed $id |
||
195 | * @param array $columns |
||
196 | * @param int $parent |
||
197 | * @return static |
||
198 | */ |
||
199 | 4 | public static function findOrFail($id, array $columns = ['*'], $parent = null) |
|
207 | |||
208 | /** |
||
209 | * Save a new model and return the instance. |
||
210 | * |
||
211 | * @param array $attributes |
||
212 | * @throws Exception |
||
213 | * @return static |
||
214 | */ |
||
215 | 8 | public static function create(array $attributes = []) |
|
229 | |||
230 | /** |
||
231 | * Destroy the models by the given id. |
||
232 | * |
||
233 | * @param mixed $id |
||
234 | */ |
||
235 | 2 | public static function destroy($id) |
|
245 | } |
||
246 |
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: