Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/04/2013, 09:34
wilmer30
 
Fecha de Ingreso: enero-2010
Mensajes: 491
Antigüedad: 14 años, 3 meses
Puntos: 12
Respuesta: Recursividad con doctrine

pues pienso que logre integrar las extensiones a mi proyecto, cuando agrego los registros de ejemplo si me funcionan, pero cuando intento
Código PHP:
Ver original
  1. $repo = $em->getRepository('Entity\Category');
  2.  
  3. $food = $repo->findOneByTitle('Food');
  4. echo $repo->childCount($food);

me vota este error:

Fatal error: Call to a member function hasField() on a non-object in C:\xampp\htdocs\gdbcb\library\Doctrine\ORM\EntityR epository.php on line 214

asi es como integro en mi recurso:
Código PHP:
Ver original
  1. //Prueba Piloto Annotation driver (Extension Gedmo)
  2.     $chainDriverImpl = new \Doctrine\ORM\Mapping\Driver\DriverChain();
  3.     $yourDefaultDriverImpl = new \Doctrine\ORM\Mapping\Driver\YamlDriver('/yml/mapping/files'); // only an example
  4.     $translatableDriverImpl = $config->newDefaultAnnotationDriver(APPLICATION_PATH . "/../library/App/Gedmo/Translatable/Entity");
  5.     $chainDriverImpl->addDriver($yourDefaultDriverImpl, 'Entity');
  6.     $chainDriverImpl->addDriver($translatableDriverImpl, 'Gedmo\Translatable');
  7.     $config->setMetadataDriverImpl($chainDriverImpl);    
  8.    
  9.     $driverImpl = $config -> newDefaultAnnotationDriver(APPLICATION_PATH ."/../library/App/Models");
  10.        
  11.     $config -> setMetadataDriverImpl($driverImpl);
  12.     $config -> setQueryCacheImpl($cache);
  13.     $config -> setProxyDir($options['proxiesPath']);
  14.     $config -> setProxyNamespace($options['proxiesPathNamespace']);
  15.     $config -> setAutoGenerateProxyClasses(('development' == APPLICATION_ENV));
  16.     $em = Doctrine\ORM\EntityManager::create(
  17.         $this -> _buildConnectionOptions($options['connection']),
  18.         $config
  19.     );

alguna idea que que puede estar mal.