Exemplo n.º 1
0
 public function getNewInstance()
 {
     /** @var $new Menu */
     $new = parent::getNewInstance();
     $new->setParentDocument(null);
     return $new;
 }
Exemplo n.º 2
0
 public function createQuery($context = 'list')
 {
     $admin = $this->isChild() ? $this->getParent() : $this;
     $query = parent::createQuery($context);
     if ($context == 'list' && $this->isChild()) {
         $id = $admin->getRequest()->get('id');
         $query->andWhere($query->getRootAlias() . '.root=:id')->setParameter('id', $id);
         $query->andWhere($query->getRootAlias() . '.id!=:id')->setParameter('id', $id);
     }
     $query->addOrderBy($query->getRootAlias() . '.root', 'ASC');
     $query->addOrderBy($query->getRootAlias() . '.left', 'ASC');
     return $query;
 }