Browse Source

Small refactoring

tags/1.5.1
Alban Jubert 6 years ago
parent
commit
5e2fe7925a
  1. 1
      src/SaveRelationsBehavior.php

1
src/SaveRelationsBehavior.php

@ -665,6 +665,7 @@ class SaveRelationsBehavior extends Behavior
$owner = $this->owner; $owner = $this->owner;
foreach ($this->_relationsCascadeDelete as $relationName => $params) { foreach ($this->_relationsCascadeDelete as $relationName => $params) {
if ($params === true) { if ($params === true) {
/** @var ActiveQuery $relation */
$relation = $owner->getRelation($relationName); $relation = $owner->getRelation($relationName);
if (!empty($owner->{$relationName})) { if (!empty($owner->{$relationName})) {
if ($relation->multiple === true) { // Has many relation if ($relation->multiple === true) { // Has many relation

Loading…
Cancel
Save