Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // presenter
- public function renderDefault()
- {
- $query = new Query\Product();
- $products = $this->productFacade->getDao()->fetch($query)->toArray();
- foreach($products as $product) {
- $product->translations->toArray();
- }
- $this->template->products = $this->entityTranslator->wrapCollection($products);
- }
- // Query/Product
- /**
- * @param Kdyby\Persistence\Queryable|Kdyby\Doctrine\EntityDao $repository
- * @return Kdyby\Doctrine\NativeQueryBuilder
- */
- private function createBasicDql(Kdyby\Persistence\Queryable $repository)
- {
- $qb = $repository->createQueryBuilder('p')
- ->innerJoin('p.translations', 't')->addSelect('t');
- foreach ($this->filter as $modifier) {
- $modifier($qb);
- }
- return $qb;
- }
Advertisement
Add Comment
Please, Sign In to add comment