diff --git a/RelationTrait.php b/RelationTrait.php index e3c9aa6..e187fcf 100644 --- a/RelationTrait.php +++ b/RelationTrait.php @@ -161,7 +161,7 @@ public function saveAll($skippedRelations = []) $db = $this->getDb(); $trans = $db->beginTransaction(); $isNewRecord = $this->isNewRecord; - $isSoftDelete = isset($this->_rt_softdelete); + $isSoftDelete = $this->hasProperty('_rt_softdelete'); try { if ($this->save()) { $error = false; @@ -347,7 +347,7 @@ public function deleteWithRelated($skippedRelations = []) /* @var $this ActiveRecord */ $db = $this->getDb(); $trans = $db->beginTransaction(); - $isSoftDelete = isset($this->_rt_softdelete); + $isSoftDelete = $this->hasProperty('_rt_softdelete'); try { $error = false; $relData = $this->getRelationData(); @@ -403,7 +403,7 @@ public function deleteWithRelated($skippedRelations = []) */ public function restoreWithRelated($skippedRelations = []) { - if (!isset($this->_rt_softrestore)) { + if (!$this->hasProperty('_rt_softrestore')) { return false; }