title: Symfony2/Doctrine - postFlush
body: <p>If you saw my previous question, this is kind of linked to it but a new question.  So I have an Entity and I have a listener linked up to this.  In my createAction I create my Object and then persist-flush it to my database.  In my listener, I have set up a postFlush function</p>
  
  <pre><code>public function postFlush(PostFlushEventArgs $args)
  {
      $em = $args-&gt;getEntityManager();
  
      foreach ($em-&gt;getUnitOfWork()-&gt;getScheduledEntityDeletions() as $entity) {
          if ($entity instanceof AvailabilityAlert) {
              var_dump("TEST");
              $this-&gt;api_service-&gt;addFlightsAction($entity);
          }
      }
  }
  </code></pre>
  
  <p>What I am trying to do in this function is get the entity that was just flushed.  I have tried all the different actions of getUnitsOfWork e.g. getScheduledEntityDeletions but for none of them I can get into where the var_dump occurs.</p>
  
  <p>How would I go about getting the flushed entity within this postFlush function?</p>