Skip to content

Commit 8a65044

Browse files
committed
Fix not deleted when hasMany relations saving
1 parent 3a51dcd commit 8a65044

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Relation/HasMany.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function save(EntityInterface $entity, $relationName, $options = [])
122122
if (count($deletedIds) || $relatedEntities === false) {
123123
$conditions = [$this->foreignKey() => $entity->primaryKey()];
124124
if (count($deletedIds)) {
125-
$conditions[$this->localKey().' :in'] = $deletedIds;
125+
$conditions[$relatedMapper->primaryKeyField().' :in'] = $deletedIds;
126126
}
127127
if ($relatedMapper->entityManager()->fields()[$this->foreignKey()]['notnull']) {
128128
$relatedMapper->delete($conditions);

0 commit comments

Comments
 (0)