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