feature/use-the-same-table-in-multiple-joins #14

Merged
bence merged 3 commits from feature/use-the-same-table-in-multiple-joins into master 2023-05-01 19:08:23 +02:00
Showing only changes of commit 70a9e492e3 - Show all commits

View File

@ -227,12 +227,16 @@ class PersistentDataManager implements IPersistentDataManager
next($data); next($data);
} else if (substr($key, 0, strlen($relation . '__')) === $relation . '__') { } else if (substr($key, 0, strlen($relation . '__')) === $relation . '__') {
$relationType = current($relations); if ($data[$relation . '__id'] !== null) {
$relationModel = new $relationType(); $relationType = current($relations);
$this->fillWithData($data, $relationModel, $withRelations, $relation); $relationModel = new $relationType();
$this->fillWithData($data, $relationModel, $withRelations, $relation);
$method = 'set' . str_replace('_', '', ucwords($relation, '_')); $method = 'set' . str_replace('_', '', ucwords($relation, '_'));
$model->$method($relationModel); $model->$method($relationModel);
} else {
next($data);
}
next($relations); next($relations);
} else { } else {