diff --git a/src/Form/Admin/AdvancedSearch/AdvancedSearchOrderFilterTranslation.php b/src/Form/Admin/AdvancedSearch/AdvancedSearchOrderFilterTranslation.php index 1378ab203d..0c51945179 100644 --- a/src/Form/Admin/AdvancedSearch/AdvancedSearchOrderFilterTranslation.php +++ b/src/Form/Admin/AdvancedSearch/AdvancedSearchOrderFilterTranslation.php @@ -6,7 +6,6 @@ use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderCityFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderCreateDateFilter; -use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderDomainFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderEmailFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderLastNameFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderNameFilter; @@ -26,7 +25,6 @@ public function __construct() $this->addFilterTranslation(OrderNumberFilter::NAME, t('Order number')); $this->addFilterTranslation(OrderCreateDateFilter::NAME, t('Created on')); $this->addFilterTranslation(OrderPriceFilterWithVatFilter::NAME, t('Price including VAT')); - $this->addFilterTranslation(OrderDomainFilter::NAME, t('Domain')); $this->addFilterTranslation(OrderStatusFilter::NAME, t('Status of order')); $this->addFilterTranslation(OrderProductFilter::NAME, t('Product in order')); $this->addFilterTranslation(OrderPhoneNumberFilter::NAME, t('Customer phone number')); diff --git a/src/Model/AdvancedSearch/OrderAdvancedSearchConfig.php b/src/Model/AdvancedSearch/OrderAdvancedSearchConfig.php index b2152db444..ed48677960 100644 --- a/src/Model/AdvancedSearch/OrderAdvancedSearchConfig.php +++ b/src/Model/AdvancedSearch/OrderAdvancedSearchConfig.php @@ -4,10 +4,8 @@ namespace Shopsys\FrameworkBundle\Model\AdvancedSearch; -use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderCityFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderCreateDateFilter; -use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderDomainFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderEmailFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderLastNameFilter; use Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderNameFilter; @@ -24,7 +22,6 @@ class OrderAdvancedSearchConfig extends AdvancedSearchConfig * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderNumberFilter $orderNumberFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderCreateDateFilter $orderCreateDateFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderPriceFilterWithVatFilter $orderPriceFilterWithVatFilter - * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderDomainFilter $orderDomainFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderStatusFilter $orderStatusFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderProductFilter $orderProductFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderPhoneNumberFilter $orderPhoneNumberFilter @@ -33,13 +30,12 @@ class OrderAdvancedSearchConfig extends AdvancedSearchConfig * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderLastNameFilter $orderLastNameFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderEmailFilter $orderEmailFilter * @param \Shopsys\FrameworkBundle\Model\AdvancedSearchOrder\Filter\OrderCityFilter $orderCityFilter - * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain + * @throws \Shopsys\FrameworkBundle\Model\AdvancedSearch\Exception\AdvancedSearchFilterAlreadyExistsException */ public function __construct( OrderNumberFilter $orderNumberFilter, OrderCreateDateFilter $orderCreateDateFilter, OrderPriceFilterWithVatFilter $orderPriceFilterWithVatFilter, - OrderDomainFilter $orderDomainFilter, OrderStatusFilter $orderStatusFilter, OrderProductFilter $orderProductFilter, OrderPhoneNumberFilter $orderPhoneNumberFilter, @@ -48,7 +44,6 @@ public function __construct( OrderLastNameFilter $orderLastNameFilter, OrderEmailFilter $orderEmailFilter, OrderCityFilter $orderCityFilter, - Domain $domain, ) { parent::__construct(); @@ -56,10 +51,6 @@ public function __construct( $this->registerFilter($orderNumberFilter); $this->registerFilter($orderCreateDateFilter); $this->registerFilter($orderStatusFilter); - - if ($domain->isMultidomain()) { - $this->registerFilter($orderDomainFilter); - } $this->registerFilter($orderProductFilter); $this->registerFilter($orderNameFilter); $this->registerFilter($orderLastNameFilter); diff --git a/src/Model/AdvancedSearchOrder/Filter/OrderDomainFilter.php b/src/Model/AdvancedSearchOrder/Filter/OrderDomainFilter.php deleted file mode 100644 index e24be453be..0000000000 --- a/src/Model/AdvancedSearchOrder/Filter/OrderDomainFilter.php +++ /dev/null @@ -1,81 +0,0 @@ - $ruleData) { - if ($ruleData->operator === self::OPERATOR_IS || $ruleData->operator === self::OPERATOR_IS_NOT) { - $dqlOperator = $this->getContainsDqlOperator($ruleData->operator); - $parameterName = 'orderDomain_' . $index; - $queryBuilder->andWhere('o.domainId ' . $dqlOperator . ' :' . $parameterName); - $queryBuilder->setParameter($parameterName, $ruleData->value); - } - } - } - - /** - * @param string $operator - * @return string - */ - protected function getContainsDqlOperator($operator) - { - switch ($operator) { - case self::OPERATOR_IS: - return '='; - case self::OPERATOR_IS_NOT: - return '!='; - } - - throw new AdvancedSearchFilterOperatorNotFoundException($operator); - } -}