casting schema to array, fixes error for array_keys when return is null

This commit is contained in:
Ceeram 2012-06-02 01:39:53 +02:00
parent e5eb7b490e
commit 048dc8d254

View file

@ -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;