-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
I can't figure out how to remove a simple relationship. Suppose I have a Person Entity which has a collection of friends (also Person). Say John is friend with Jimmy. I did the following:
$john->removeFriend($jimmy); // already retrieved from db
$em->flush();and the removeFriend function in Person class looks like this:
function removeFriend($person) {
if ($this->friends->contains($person)) {
$this->friends->remove($person);
}
}The in-memory collection is updated. John is not friend with Jimmy anymore. However, this is not persisted into the db.
Metadata
Metadata
Assignees
Labels
No labels