Ejemplo n.º 1
0
 protected function createQuery(Queryable $queryable)
 {
     $qb = $queryable->createQueryBuilder($this->entityClass, 'e');
     foreach ($this->filters as $filter) {
         list($field, $value) = $filter;
         if ($value === NULL && $field instanceof \Closure) {
             $field($qb, 'e');
         } else {
             $qb->whereCriteria([$field => $value]);
         }
     }
     foreach ($this->orderBy as $field => $direction) {
         $qb->autoJoinOrderBy($field, $direction);
     }
     return $qb;
 }
Ejemplo n.º 2
0
 protected function doFetch(Queryable $queryable)
 {
     return $queryable->getEntityManager()->getRepository($this->entityName)->findPairs($this->filter, $this->value, $this->orderBy, $this->key);
 }
Ejemplo n.º 3
0
 protected function doFetch(Queryable $queryable)
 {
     return $queryable->getEntityManager()->find($this->entityName, $this->id);
 }