doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.9k stars 2.5k forks source link

UnitOfWork::isScheduledForDelete ignores UnitOfWork::$orphanRemovals #5615

Open mtal opened 8 years ago

mtal commented 8 years ago

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

Ocramius commented 8 years ago

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

mtal commented 8 years ago

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