read objects persisted but not yet flushed with doctrine

前端 未结 3 712
慢半拍i
慢半拍i 2021-01-03 22:57

I\'m new to symfony2 and doctrine. here is the problem as I see it. i cannot use :

$repository = $this->getDoctrine()->getRepository(\         


        
3条回答
  •  时光说笑
    2021-01-03 23:30

    I think you might want to have a look at this function:

    $entityManager->getUnitOfWork()->getScheduledEntityInsertions()
    

    Gives you back a list of entity objects which are persisting yet.

    Hmm, I didn't really read your question well, with the above you will retrieve a full list (as an array) but you cannot query it like with getRepository. I will try found something for u..

提交回复
热议问题