title: Persist another object withing a lifecycle event
body: <p>Within a given lifecycle callback, can another object be modified and added to the same flush?  Originally, I didn't include a second flush() in the callback and it wasn't being saved.  I try adding one and it is saved but initiates multiple calls to <code>EntityOne::preFlush()</code> and I needed to add a flag to ignore the future calls which doesn't seem right.  What is the correct way to do this?</p>
  
  <pre><code>&lt;?php
  class MyService
  {
      public function save()
      {
          //...
          $this-&gt;em-&gt;persist($entityTwo);
          $this-&gt;em-&gt;flush();      
      }
  }
  
  class EntityOne
  {
      /**
      * @var EntityTwo
      */
      private $entityTwo;
  
      private $preFlushComplete=false;
  
      /**
      * @ORM\PreFlush
      */
      public function preFlush(PreFlushEventArgs $event)
      {
          if(!$this-&gt;preFlushComplete) {
              $this-&gt;preFlushComplete=true;
              $this-&gt;entityTwo-&gt;setTime(now());
              $event-&gt;getEntityManager()-&gt;persist($this-&gt;entityTwo);
          }
      }
  }
  </code></pre>