Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/04/2013, 11:39
wilmer30
 
Fecha de Ingreso: enero-2010
Mensajes: 491
Antigüedad: 14 años, 3 meses
Puntos: 12
Uso de extension Tree Gedmo

Hola:

Intento usar la extension Tree de para Doctrine, logro agregar a la base de datos esto:
Cita:
+----+----------+---------------+-----+-----+-----+------+
| id | menu_id | menu | lft | lvl | rgt | root |
+----+----------+---------------+-----+-----+-----+------+
| 1 | NULL | Food | 1 | 0 | 8 | 1 |
| 2 | 1 | Fruits | 2 | 1 | 3 | 1 |
| 3 | 1 | Vegetables | 4 | 1 | 7 | 1 |
| 4 | 3 | Carrots | 5 | 2 | 6 | 1 |
+----+---------+----------------+-----+-----+-----+------+
4 rows in set
pero para recuperar con
Código PHP:
        $repo $this->em->getRepository('Application\Entity\Menu');        
        
$food $repo->findOneByMenu('Food');
        echo 
$repo->childCount($food); 
me arroja este error:

Uncaught exception 'BadMethodCallException' with message 'Undefined method 'childCount'. The method name must start with either findBy or findOneBy!'

en Gedmo\Tree\RepositoryInterface.php si existe el 'metodo childCount'

en mi application.ini integre de esta manera la extension:
Cita:
resources.doctrine.dbal.connections.default.eventS ubscribers[] = "Gedmo\Translatable\TranslatableListener"
resources.doctrine.dbal.connections.default.eventS ubscribers[] = "Gedmo\Tree\TreeListener"
resources.doctrine.dbal.connections.default.eventS ubscribers[] = "Gedmo\Sluggable\SluggableListener"
resources.doctrine.dbal.connections.default.eventS ubscribers[] = "Gedmo\Sortable\SortableListener"
una ayuda por favor.