Пример #1
0
 /**
  * Create a query based on the index definition.
  * @param IndexDefinitionInterface $definition
  * @return Query
  */
 public function resolveQuery(IndexDefinitionInterface $definition)
 {
     $em = $definition->getParent()->getEntityManager();
     $builder = $em->createQueryBuilder();
     $builder->select(self::BASE_NAME);
     $builder->from($definition->getBaseEntity(), self::BASE_NAME);
     $this->addColumns($builder, $definition->getColumns());
     $this->addDefaultSort($builder, $definition);
     return $this->modifyQuery($builder, $definition);
 }