Ejemplo n.º 1
0
 public function getManagerForClass($class)
 {
     if (is_subclass_of($class, 'Doctrine\\Common\\Persistence\\PersistentObject')) {
         return PersistentObject::getObjectManager();
     } else {
         foreach ($this->getManagerNames() as $id) {
             $manager = $this->getManager($id);
             if (!$manager->getMetadataFactory()->isTransient($class)) {
                 return $manager;
             }
         }
     }
     return null;
 }
Ejemplo n.º 2
0
 public function testGetObjectManager()
 {
     $this->assertSame($this->om, PersistentObject::getObjectManager());
 }