UnitOfWork::isScheduledForDelete ignores UnitOfWork::$orphanRemovals #4976

Open
opened 2026-01-22 14:55:00 +01:00 by admin · 2 comments
Owner

Originally created by @mtal on GitHub (Jan 18, 2016).

The UnitOfWork::isScheduledForDelete returns false for entity that will be deleted by orphan (contains in UnitOfWork::$orphanRemovals)

There is no accessors to UnitOfWork::$orphanRemovals variable

Originally created by @mtal on GitHub (Jan 18, 2016). The UnitOfWork::isScheduledForDelete returns false for entity that will be deleted by orphan (contains in UnitOfWork::$orphanRemovals) There is no accessors to UnitOfWork::$orphanRemovals variable
admin added the Improvement label 2026-01-22 14:55:00 +01:00
Author
Owner

@Ocramius commented on GitHub (Jan 20, 2016):

We wouldn't add accessors for UnitOfWork#$orphanRemovals anyway.

Could you check if any API is relying on Doctrine\ORM\UnitOfWork#isScheduledForDelete(), and can we add orphan removals to that particular API, eventually?

Also suggested: check if the Gedmo softdeleteable extension provides a way to soft-delete orphan removals (and where it is done): it may give you hints about possible workarounds

@Ocramius commented on GitHub (Jan 20, 2016): We wouldn't add accessors for `UnitOfWork#$orphanRemovals` anyway. Could you check if any API is relying on `Doctrine\ORM\UnitOfWork#isScheduledForDelete()`, and can we add orphan removals to that particular API, eventually? Also suggested: check if the Gedmo softdeleteable extension provides a way to soft-delete orphan removals (and where it is done): it may give you hints about possible workarounds
Author
Owner

@mtal commented on GitHub (Jan 20, 2016):

orphanRemovals are fully hidden inside onFlush events.
but it is still scheduled deletions so getScheduledEntityDeletions and isScheduledForDelete must see it.

@mtal commented on GitHub (Jan 20, 2016): orphanRemovals are fully hidden inside onFlush events. but it is still scheduled deletions so getScheduledEntityDeletions and isScheduledForDelete must see it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4976