My entity User
is related to other entities through OneToOne relations, and I'm cascading "delete" for all of them.
I'm using SoftDeleteable behavior extension, so when I remove a User
, the entity is not actually removed from the database: the deletedAt
field is simply set to DateTime(now), and so are all the deletedAt
fields of the related entites.
Now, when I want to restore a User, I do as suggested in the docs:
$em->getFilters()->disable('soft-deleteable');
$user->setDeletedAt(null);
My problem is all the related entities stay deleted when I do this. Any idea how I could cascade the setDeleted(null) to all of them automatically?