如何为 UoW 列出所有处于新状态的实体

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

我想列出所有将要通过 INSERT wen flush()ing 持久化的实体,因此与 NEW 状态相关联。 那可能吗?谢谢

是的,这是可能的。 getScheduledEntityInsertions() returns 计划为 UoW 对象插入实体。 所以只需调用 $entityManager->getUnitOfWork()->getScheduledEntityInsertions()