mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
casting schema to array, fixes error for array_keys when return is null
This commit is contained in:
parent
e5eb7b490e
commit
048dc8d254
1 changed files with 1 additions and 1 deletions
|
@ -1166,7 +1166,7 @@ class Model extends Object implements CakeEventListener {
|
|||
*/
|
||||
protected function _setAliasData($data) {
|
||||
$models = array_keys($this->getAssociated());
|
||||
$schema = array_keys($this->schema());
|
||||
$schema = array_keys((array)$this->schema());
|
||||
foreach ($data as $field => $value) {
|
||||
if (in_array($field, $schema) || !in_array($field, $models)) {
|
||||
$data[$this->alias][$field] = $value;
|
||||
|
|
Loading…
Reference in a new issue