title: How to use entityManager inside Entity?
body: <p>I have this function in Entity class but the getDoctrine do not fond...</p>
  
  <pre><code>public function getObject()
  {
      $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  
      switch($this-&gt;objectType)
      {
          case 'video':
              return $em-&gt;getRepository('fdj2012AdminBundle:Video')-&gt;find($this-&gt;objectId);
              break;
          case 'default':
              return false;
              break;
      }
  }
  </code></pre>
  
  <p>How to use entityManager inside my Entity ?</p>