diff --git a/RelationTrait.php b/RelationTrait.php index 079cd98..0c9822f 100644 --- a/RelationTrait.php +++ b/RelationTrait.php @@ -36,7 +36,7 @@ public function loadAll($POST) if ($isManyMany) { $container = []; foreach ($value as $relPost) { - if (!empty(array_filter($relPost))) { + if (array_filter($relPost)) { $condition = []; $condition[$this->primaryKey()[0]] = $this->primaryKey; foreach ($relPost as $relAttr => $relAttrVal) { @@ -170,6 +170,7 @@ public function saveAll() } } else { //No Children left + //echo "No Children left"; if (!$this->isNewRecord) { $relData = $this->getRelationData(); foreach ($relData as $rel) {