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; }
protected function doFetch(Queryable $queryable) { return $queryable->getEntityManager()->getRepository($this->entityName)->findPairs($this->filter, $this->value, $this->orderBy, $this->key); }
protected function doFetch(Queryable $queryable) { return $queryable->getEntityManager()->find($this->entityName, $this->id); }