Search code examples
symfonydoctrine-ormsymfony-2.8

how to list all the entities in NEW state for a UoW


I would like to list all the entities that are about to be persisted through an INSERT wen flush()ing , therefore assosiated with a NEW state. Is that possible? Thank you


Solution

  • Yes, it's possible. getScheduledEntityInsertions() returns scheduled entity insertions for UoW object. So just call $entityManager->getUnitOfWork()->getScheduledEntityInsertions()