FIX: array_walk returns bool and tertiary operator

This commit is contained in:
2021-08-01 20:50:42 -04:00
parent 293b5af3ff
commit 2bf938a9b7
2 changed files with 10 additions and 6 deletions

View File

@ -133,9 +133,10 @@ abstract class Model extends BaseModel implements ModelInterface {
$obj = static::find($factory, $input);
} else {
$where = $data;
$where = array_values(array_walk($where, function(&$item, $key) {
array_walk($where, function(&$item, $key) {
$item = [$key, $item];
}));
});
$where = array_values($where);
$obj = $factory->find($class)->where($where)->one();
}
if ($obj === null) {