Beispiel #1
0
 /**
  * Generates a customized query for this entity/repository
  *
  * 1) $this->queryBuilder will contain a full select
  * 2) sorting is added
  * 3) search is added
  * 4) pagination limiting is is added
  *
  * var_dump($this->queryBuilder->getDQL());
  *
  * @see $this->queryBuilder
  */
 private function assembleQuery()
 {
     // get the "finder" method to use on the repository
     #$methodname = $this->getRepositoryMethodName();
     // call repository method with variable methodname
     #$this->query = $this->getDoctrineRepository()->$methodname();
     /**
      * get QueryBuilder so that we can append (sorting, search etc) to the Query
      */
     $this->queryBuilder = Clansuite_CMS::getEntityManager()->createQueryBuilder()->select('a')->from($this->getDoctrineEntityName(), 'a');
     $this->addSortingToQuery();
     $this->addSearchToQuery();
     $query = $this->addPaginationLimitToQuery();
     return $query;
 }