title: Symfony 2 one entity event listener is running on every entity load
body: <p>I'm new to Symfony and following <a href="http://jobeet.symfony.gr.jp" rel="nofollow">the Jobeet tutorial</a>. I have three entities - Job, Category and User. I have the following service listener.</p>
  
  <p><strong>src/Ibw/JobeetBundle/Resources/config/services.yml</strong></p>
  
  <pre><code>services:
      ibw.jobeet.entity.job.container_aware:
          class: Ibw\JobeetBundle\Doctrine\Event\Listener\JobListener
          calls:
              - [setContainer, ["@service_container"]]
          tags:
              - { name: doctrine.event_listener, event: postLoad }
  </code></pre>
  
  <p><strong>src/Ibw/JobeetBundle/Doctrine/Event/Listener/JobListener.php</strong></p>
  
  <pre><code>&lt;?php
  namespace Ibw\JobeetBundle\Doctrine\Event\Listener;
  
  use Symfony\Component\DependencyInjection\ContainerInterface;
  use Doctrine\ORM\Event\LifecycleEventArgs;
  
  class JobListener
  {
      /** @var ContainerInterface */
      protected $container;
  
      /**
      * @param ContainerInterface @container
      */
      public function setContainer(ContainerInterface $container)
      {
          $this-&gt;container = $container;
      }
  
      /**
       * @ORM\PostLoad
       */
      public function postLoad(LifecycleEventArgs $eventArgs)
      {
          $entity = $eventArgs-&gt;getEntity();
          if (method_exists($entity, 'setContainer')) {
              $entity-&gt;setContainer($this-&gt;container);
          }
      }
  }
  </code></pre>
  
  <p>I expected <code>postLoad</code> would be invoked only for the <strong>Job</strong> entity, but I found that it is also called for the other two entities <strong>Category</strong> and <strong>User</strong>. I only define <code>setContainer</code> in the <strong>Job</strong> entity. So, I got the undefined method for the other entities. My workaround is to check with <code>method_exists</code>. </p>
  
  <p>Is there any way to run <code>postLoad</code> on a particular entity only?</p>