コード例 #1
0
 public function getRootsAsArray($id = null)
 {
     $criteria = Criteria::create()->where(Criteria::expr()->isNull('parent'));
     if ($id) {
         $criteria->andWhere(Criteria::expr()->neq('id', $id));
     }
     $list = parent::matching($criteria);
     $res = array();
     foreach ($list as $element) {
         $res[$element->getId()] = $element->getName();
     }
     return $res;
 }
コード例 #2
0
 public function getSortedWidgets(array $groupValues = [])
 {
     $qb = parent::getBySortableGroupsQueryBuilder($groupValues)->select('n', 'w')->leftJoin('n.widget', 'w');
     return $qb->getQuery();
 }
コード例 #3
0
 public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 {
     $orderBy['weight'] = 'ASC';
     return parent::findBy($criteria, $orderBy, $limit, $offset);
 }