Browse Source

Merge pull request #7 from sankam-nikolya/master

Update SaveRelationsBehavior.php
tags/1.1.0
Alban Jubert 9 years ago
parent
commit
05dca3d2c7
  1. 3
      src/SaveRelationsBehavior.php

3
src/SaveRelationsBehavior.php

@ -84,6 +84,9 @@ class SaveRelationsBehavior extends Behavior
}
if ($relation->multiple === true) {
$newRelations = [];
if(!is_array($value)){
$value = [];
}
foreach ($value as $entry) {
if ($entry instanceof $relation->modelClass) {
$newRelations[] = $entry;

Loading…
Cancel
Save