title: How to get Container object from LifecycleEventArgs of postLoad in Entity?
body: <p>I'm trying to inject the Container object (which is available in controllers) into an Entity using <code>postLoad</code> <code>lifecycleCallbacks</code>. The argument to the <code>postLoad</code> method is <code>LifecycleEventArgs</code>. I could see the container property (which I want to retrieve) in <code>EventManager</code> of <code>LifecycleEventArgs</code> according to the dump output, but it seems to be a private property and there is no <code>getContainer()</code> method in <code>EventManager</code>. The below is my code.</p>
  
  <p>service.yml</p>
  
  <pre><code>services:
      ibw.jobeet.entity.job.container_aware:
          class: Ibw\JobeetBundle\Entity\Job
          tags:
              - { name: doctrine.event_listener, event: postLoad }
  </code></pre>
  
  <p>Ibw\JobeetBundle\Entity\Job.php</p>
  
  <pre><code>&lt;?php
  namespace Ibw\JobeetBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Doctrine\ORM\Event\LifecycleEventArgs;
  use Symfony\Component\Validator\Constraints as Assert;
  use Symfony\Component\HttpFoundation\File\UploadedFile;
  use Symfony\Component\DependencyInjection\ContainerAware;
  use Symfony\Component\DependencyInjection\ContainerInterface;
  
  use Ibw\JobeetBundle\Utils\Jobeet;
  
  /**
   * Job
   */
  class Job
  {
      //....
      /**
       * @var Container
       */
      protected $container;
  
      public function postLoad(LifecycleEventArgs $eventArgs)
      {
          $entity = $eventArgs-&gt;getEntity();
          $entityManager = $eventArgs-&gt;getEntityManager();
          $eventManager = $entityManager-&gt;getEventManager();
          echo '&lt;pre&gt;';
          \Doctrine\Common\Util\Debug::dump($eventManager, 3);
  
          // want to get $eventManager-&gt;container here
  
          exit;
      }
      //....
  }
  </code></pre>
  
  <p>Is there any other way to retrieve it?</p>