Skip to content

Commit

Permalink
Fix hasMany relations saving
Browse files Browse the repository at this point in the history
  • Loading branch information
kitchenu committed May 4, 2017
1 parent fc5c73e commit 60d208e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Relation/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function save(EntityInterface $entity, $relationName, $options = [])
}

foreach ($oldEntities as $oldRelatedEntity) {
if (!in_array($oldRelatedEntity, $relatedIds)) {
if (!in_array($oldRelatedEntity->primaryKey(), $relatedIds)) {
$deletedIds[] = $oldRelatedEntity->primaryKey();
}
}
Expand Down

0 comments on commit 60d208e

Please sign in to comment.