protected function getConditions()
 {
     $conditions = parent::getConditions();
     if (null !== $this->context) {
         $conditions->add(new Eq('shop', $this->context->getCurrentShopIdentifier()));
     }
     return $conditions;
 }
 /**
  * Adds additional criteria to query builder. Filters dataset by current shop scope
  *
  * @param ColumnCollection        $columns
  * @param DataSetRequestInterface $request
  *
  * @return \Doctrine\ORM\QueryBuilder
  */
 public function getQueryBuilder(ColumnCollection $columns, DataSetRequestInterface $request)
 {
     $queryBuilder = parent::getQueryBuilder($columns, $request);
     if (null !== $this->context) {
         $expression = $queryBuilder->expr()->eq('page_shops.id', ':shop');
         $queryBuilder->andWhere($expression);
         $queryBuilder->setParameter('shop', $this->context->getCurrentShopIdentifier());
     }
     return $queryBuilder;
 }
Esempio n. 3
0
 public function getCurrentShop()
 {
     return $this->shopContext->getCurrentShop();
 }