lib/Doctrine/ORM/PersistentObject.php
public function injectEntityManager(EntityManagerInterface $entityManager, ClassMetadata $classMetadata) : void
    {
        if ($entityManager !== self::$entityManager) {
            throw new RuntimeException(
                'Trying to use PersistentObject with different EntityManager instances. ' .
                'Was PersistentObject::setEntityManager() called?'
            );
        }

        $this->cm = $classMetadata;
    }
public function injectEntityManager(EntityManagerInterface $entityManager, ClassMetadata $classMetadata) : void
    {
        if ($entityManager !== self::$entityManager) {
            throw new RuntimeException(
                'Trying to use PersistentObject with different EntityManager instances. ' .
                'Was PersistentObject::setEntityManager() called?'
            );
        }

        $this->cm = $classMetadata;
    }
public function injectEntityManager ( EntityManagerInterface $ entityManager , ClassMetadata $ classMetadata ) : void { if ( $ entityManager !== self :: $ entityManager ) { throw new RuntimeException ( 'Trying to use PersistentObject with different EntityManager instances. ' . 'Was PersistentObject::setEntityManager() called?' ) ; } $ this -> cm = $ classMetadata ; }
Injects the Doctrine Object Manager.

@throws RuntimeException
Injects the Doctrine Object Manager .