Exemple #1
0
 public function initialise($container)
 {
     $this->manager = $container->get('doctrine')->getEntityManager($this->managerName);
     $this->ormMetadata = $this->manager->getClassMetadata($this->entityName);
     $this->class = $this->ormMetadata->getReflectionClass()->name;
     $mapping = $container->get('grid.mapping.manager');
     /** todo autoregister mapping drivers with tag */
     $mapping->addDriver($this, -1);
     $this->metadata = $mapping->getMetadata($this->class, $this->group);
     $this->groupBy = $this->metadata->getGroupBy();
 }
Exemple #2
0
 public function initialise($container)
 {
     $doctrine = $container->get('doctrine');
     $this->manager = version_compare(Kernel::VERSION, '2.1.0', '>=') ? $doctrine->getManager($this->managerName) : $doctrine->getManager($this->managerName);
     $this->ormMetadata = $this->manager->getClassMetadata($this->entityName);
     $this->class = $this->ormMetadata->getReflectionClass()->name;
     /*
               if(empty($this->metadata)){
               $mapping = $container->get('grid.mapping.manager');
     
               $mapping->addDriver($this, -1);
               $this->metadata = $mapping->getMetadata($this->class, $this->group);
               } */
     $this->groupBy = $this->metadata->getGroupBy();
 }