Skip to content

Commit

Permalink
[DDC-2074] Fixed bug regarding clearing PC's without owner
Browse files Browse the repository at this point in the history
When calling clear on a PC that has no owner (e.g. because it was
cloned), it can't be deleted as there is no metadata available.
In these cases, it shouldn't be scheduled for deletion.
  • Loading branch information
Jan Kramer authored and beberlei committed Nov 25, 2012
1 parent 83943e8 commit c90ed73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/PersistentCollection.php
Expand Up @@ -655,7 +655,7 @@ public function clear()

$this->initialized = true; // direct call, {@link initialize()} is too expensive

if ($this->association['isOwningSide']) {
if ($this->association['isOwningSide'] && $this->owner) {
$this->changed();

$uow->scheduleCollectionDeletion($this);
Expand Down

0 comments on commit c90ed73

Please sign in to comment.