getQueryBuilder() protected method

protected getQueryBuilder ( WellCommerce\Component\DataSet\Request\DataSetRequestInterface $request ) : Doctrine\ORM\QueryBuilder
$request WellCommerce\Component\DataSet\Request\DataSetRequestInterface
return Doctrine\ORM\QueryBuilder
Exemplo n.º 1
0
 protected function getQueryBuilder(DataSetRequestInterface $request) : QueryBuilder
 {
     $queryBuilder = parent::getQueryBuilder($request);
     $queryBuilder->leftJoin(CurrencyRate::class, 'currency_rate', Expr\Join::WITH, 'currency_rate.currencyFrom = product.sellPrice.currency AND currency_rate.currencyTo = :targetCurrency');
     $queryBuilder->setParameter('targetCurrency', $this->getRequestHelper()->getCurrentCurrency());
     $queryBuilder->setParameter('date', (new \DateTime())->setTime(0, 0, 1));
     return $queryBuilder;
 }
Exemplo n.º 2
0
 protected function getQueryBuilder(DataSetRequestInterface $request) : QueryBuilder
 {
     $queryBuilder = parent::getQueryBuilder($request);
     $expression = $queryBuilder->expr()->eq('currency.enabled', ':enabled');
     $queryBuilder->andWhere($expression);
     $queryBuilder->setParameter('enabled', true);
     return $queryBuilder;
 }
 protected function getQueryBuilder(DataSetRequestInterface $request) : QueryBuilder
 {
     $queryBuilder = parent::getQueryBuilder($request);
     $expression = $queryBuilder->expr()->eq('order_product.order', ':order');
     $queryBuilder->andWhere($expression);
     $queryBuilder->setParameter('order', $this->provider->getCurrentOrderIdentifier());
     $queryBuilder->setParameter('date', (new \DateTime())->setTime(0, 0, 1));
     return $queryBuilder;
 }