HosipLan

Untitled

Oct 15th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. // presenter
  2.  
  3.     public function renderDefault()
  4.     {
  5.         $query = new Query\Product();
  6.         $products = $this->productFacade->getDao()->fetch($query)->toArray();
  7.         foreach($products as $product) {
  8.             $product->translations->toArray();
  9.         }
  10.  
  11.         $this->template->products = $this->entityTranslator->wrapCollection($products);
  12.     }
  13.  
  14.  
  15. // Query/Product
  16.  
  17.     /**
  18.      * @param Kdyby\Persistence\Queryable|Kdyby\Doctrine\EntityDao $repository
  19.      * @return Kdyby\Doctrine\NativeQueryBuilder
  20.      */
  21.     private function createBasicDql(Kdyby\Persistence\Queryable $repository)
  22.     {
  23.         $qb = $repository->createQueryBuilder('p')
  24.             ->innerJoin('p.translations', 't')->addSelect('t');
  25.  
  26.         foreach ($this->filter as $modifier) {
  27.             $modifier($qb);
  28.         }
  29.  
  30.         return $qb;
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment