diff --git a/RelationTrait.php b/RelationTrait.php index fbeb1fe..bfb9691 100644 --- a/RelationTrait.php +++ b/RelationTrait.php @@ -51,8 +51,9 @@ public function loadAll($POST, $skippedRelations = []) $condition = []; $condition[$relPKAttr[0]] = $this->primaryKey; foreach ($relPost as $relAttr => $relAttrVal) { - if (in_array($relAttr, $relPKAttr)) + if (in_array($relAttr, $relPKAttr)){ $condition[$relAttr] = $relAttrVal; + } } $relObj = $relModelClass::findOne($condition); if (is_null($relObj)) { @@ -103,8 +104,9 @@ public function saveAll($skippedRelations = []) /* @var $records ActiveRecord */ foreach ($this->relatedRecords as $name => $records) { - if (in_array($name, $skippedRelations)) + if (in_array($name, $skippedRelations)){ continue; + } if (!empty($records)) { $AQ = $this->getRelation($name);