Example #1
0
 /**
  * @param EntityManager $em
  * @param ClassMetadata $class
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     // Bind additional conditions to the nested set repository
     $entities = array(Page::CN(), ApplicationPage::CN(), GroupPage::CN());
     $orList = array();
     foreach ($entities as $entityName) {
         $orList[] = "e INSTANCE OF {$entityName}";
     }
     $additionalCondition = implode(' OR ', $orList);
     $additionalConditionSql = "discr IN ('page', 'application', 'group')";
     $this->nestedSetRepository->setAdditionalCondition($additionalCondition, $additionalConditionSql);
 }
 /**
  * @param EntityManager $em
  * @param ClassMetadata $class
  */
 public function __construct(EntityManager $em, ClassMetadata $class)
 {
     parent::__construct($em, $class);
     // Bind additional conditions to the nested set repository
     $this->nestedSetRepository->setAdditionalCondition(sprintf('e INSTANCE OF %s', Template::CN()), 'discr IN ("template")');
 }