@@ -56,6 +56,7 @@ use Lc\CaracoleBundle\Resolver\SectionResolver; | |||
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; | |||
use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto; | |||
use Lc\SovBundle\Component\EntityComponent; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Solver\Setting\SettingSolver; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Component\HttpFoundation\Response; | |||
@@ -124,33 +125,28 @@ trait AdminControllerTrait | |||
return $responseParameters; | |||
} | |||
public function createIndexQueryBuilder( | |||
public function createIndexRepositoryQuery( | |||
SearchDto $searchDto, | |||
EntityDto $entityDto, | |||
FieldCollection $fields, | |||
FilterCollection $filters | |||
): QueryBuilder { | |||
$queryBuilder = parent::createIndexQueryBuilder( | |||
): RepositoryQueryInterface { | |||
$repositoryQuery = parent::createIndexRepositoryQuery( | |||
$searchDto, | |||
$entityDto, | |||
$fields, | |||
$filters | |||
); | |||
if ($this->isInstanceOf(FilterMerchantInterface::class)) { | |||
$queryBuilder->andWhereMerchant('entity', $this->get(MerchantResolver::class)->getCurrent()); | |||
} | |||
if ($this->isInstanceOf(FilterMultipleMerchantsInterface::class)) { | |||
$queryBuilder->andWhere(':merchant MEMBER OF entity.merchants'); | |||
$queryBuilder->setParameter('merchant', $this->get(MerchantResolver::class)->getCurrent()); | |||
if ($this->isInstanceOf(FilterMerchantInterface::class) || $this->isInstanceOf(FilterMultipleMerchantsInterface::class)) { | |||
$repositoryQuery->filterByMerchant($this->get(MerchantResolver::class)->getCurrent()); | |||
} | |||
if ($this->isInstanceOf(FilterSectionInterface::class)) { | |||
$queryBuilder->andWhereSection('entity', $this->get(SectionResolver::class)->getCurrent()); | |||
$repositoryQuery->filterBySection($this->get(SectionResolver::class)->getCurrent()); | |||
} | |||
return $queryBuilder; | |||
return $repositoryQuery; | |||
} | |||
@@ -9,11 +9,17 @@ use Lc\CaracoleBundle\Container\Config\TaxRateContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Factory\Config\TaxRateFactory; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class TaxRateAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(TaxRateContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
return [ |
@@ -11,10 +11,15 @@ use Lc\CaracoleBundle\Container\Config\UnitContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Factory\Config\UnitFactory; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class UnitAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(UnitContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ |
@@ -29,12 +29,18 @@ use Lc\CaracoleBundle\Model\Credit\CreditHistoryModel; | |||
use Lc\CaracoleBundle\Model\Order\OrderPaymentModel; | |||
use Lc\CaracoleBundle\Model\User\UserMerchantInterface; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class CreditHistoryAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(CreditHistoryContainer::class)->getRepositoryQuery(); | |||
} | |||
public function overrideGlobalActions(?ActionCollection $actions): void | |||
{ | |||
parent::overrideGlobalActions($actions); |
@@ -14,11 +14,17 @@ use Lc\CaracoleBundle\Field\Address\AddressField; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class MerchantAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(MerchantContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
$panel = parent::configureFields($pageName); |
@@ -6,6 +6,7 @@ use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||
use Lc\SovBundle\Container\Newsletter\NewsletterContainer; | |||
use Lc\SovBundle\Controller\Newsletter\NewsletterAdminController as SovNewsletterAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class NewsletterAdminController extends SovNewsletterAdminController | |||
{ |
@@ -6,13 +6,20 @@ namespace Lc\CaracoleBundle\Controller\Order; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Container\Order\OrderShopContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateModel; | |||
use Lc\CaracoleBundle\Model\Config\UnitModel; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class OrderShopAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(OrderShopContainer::class)->getRepositoryQuery(); | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Controller\Order; | |||
use Lc\CaracoleBundle\Container\Order\OrderStatusContainer; | |||
use Lc\CaracoleBundle\Controller\AbstractAdminController; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class OrderStatusAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(OrderStatusContainer::class)->getRepositoryQuery(); | |||
} | |||
} |
@@ -5,11 +5,17 @@ namespace Lc\CaracoleBundle\Controller\PointSale; | |||
use Lc\CaracoleBundle\Container\PointSale\PointSaleContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class PointSaleAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(PointSaleContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
return $this->getPointSaleContainer() |
@@ -8,16 +8,23 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField; | |||
use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\SovBundle\Field\ToggleField; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class ProductCategoryAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(ProductCategoryContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
return array_merge( |
@@ -14,6 +14,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Container\Order\OrderShopContainer; | |||
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||
use Lc\CaracoleBundle\Field\Address\AddressField; | |||
@@ -22,6 +23,7 @@ use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\BooleanField; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Symfony\Component\HttpFoundation\RequestStack; | |||
use Symfony\Component\HttpFoundation\Response; | |||
@@ -29,16 +31,22 @@ abstract class ProductFamilyAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function createIndexQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder | |||
{ | |||
$queryBuilder = parent::createIndexQueryBuilder($searchDto, $entityDto, $fields, $filters); | |||
$queryBuilder->leftJoin('entity.productFamilySectionProperties', 'pfsp'); | |||
$queryBuilder->andWhereSection('pfsp', $this->getSectionCurrent()); | |||
$queryBuilder->addOrderBy('entity.id'); | |||
return $queryBuilder; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(ProductFamilyContainer::class)->getRepositoryQuery(); | |||
} | |||
// public function createIndexQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder | |||
// { | |||
// $queryBuilder = parent::createIndexQueryBuilder($searchDto, $entityDto, $fields, $filters); | |||
// | |||
// $queryBuilder->leftJoin('entity.productFamilySectionProperties', 'pfsp'); | |||
// $queryBuilder->andWhereSection('pfsp', $this->getSectionCurrent()); | |||
// $queryBuilder->addOrderBy('entity.id'); | |||
// return $queryBuilder; | |||
// } | |||
public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | |||
{ | |||
$responseParameters = parent::configureResponseParameters($responseParameters); |
@@ -6,10 +6,12 @@ namespace Lc\CaracoleBundle\Controller\Reduction; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateModel; | |||
use Lc\CaracoleBundle\Model\Config\UnitModel; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class ReductionCartAdminController extends AbstractAdminController | |||
@@ -17,5 +19,9 @@ abstract class ReductionCartAdminController extends AbstractAdminController | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(ReductionCartContainer::class)->getRepositoryQuery(); | |||
} | |||
} |
@@ -6,10 +6,12 @@ namespace Lc\CaracoleBundle\Controller\Reduction; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateModel; | |||
use Lc\CaracoleBundle\Model\Config\UnitModel; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class ReductionCatalogAdminController extends AbstractAdminController | |||
@@ -17,5 +19,9 @@ abstract class ReductionCatalogAdminController extends AbstractAdminController | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(ReductionCatalogContainer::class)->getRepositoryQuery(); | |||
} | |||
} |
@@ -6,13 +6,21 @@ namespace Lc\CaracoleBundle\Controller\Reduction; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Container\Reduction\ReductionCreditContainer; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateModel; | |||
use Lc\CaracoleBundle\Model\Config\UnitModel; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class ReductionCreditAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(ReductionCreditContainer::class)->getRepositoryQuery(); | |||
} | |||
} |
@@ -11,11 +11,17 @@ use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Factory\Section\OpeningFactory; | |||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class OpeningAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(OpeningContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
$fields = parent::configureFields($pageName); |
@@ -16,6 +16,7 @@ use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\BooleanField; | |||
use Lc\SovBundle\Field\CKEditorField; | |||
use Lc\SovBundle\Field\StatusField; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Symfony\Component\HttpFoundation\Session\SessionFactory; | |||
use Symfony\Component\Routing\Annotation\Route; | |||
@@ -24,6 +25,12 @@ abstract class SectionAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(SectionContainer::class)->getRepositoryQuery(); | |||
} | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
return array_merge( |
@@ -3,8 +3,6 @@ | |||
namespace Lc\CaracoleBundle\Controller\Site; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Factory\Site\NewsFactory; | |||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||
use Lc\SovBundle\Container\Site\NewsContainer; | |||
use Lc\SovBundle\Controller\Site\NewsAdminController as SovNewsAdminController; |
@@ -7,11 +7,13 @@ use Lc\CaracoleBundle\Factory\Site\PageFactory; | |||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||
use Lc\SovBundle\Container\Site\PageContainer; | |||
use Lc\SovBundle\Controller\Site\PageAdminController as SovPageAdminController; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
abstract class PageAdminController extends SovPageAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function createEntity(string $entityFqcn) | |||
{ | |||
return $this->getPageContainer() |
@@ -2,13 +2,15 @@ | |||
namespace Lc\CaracoleBundle\Controller\Ticket; | |||
use App\Entity\Ticket\Ticket; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||
use Lc\SovBundle\Container\Ticket\TicketContainer; | |||
use Lc\SovBundle\Controller\Ticket\TicketAdminController as SovTicketAdminController; | |||
use Lc\CaracoleBundle\Factory\Ticket\TicketFactory; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
class TicketAdminController extends SovTicketAdminController | |||
abstract class TicketAdminController extends SovTicketAdminController | |||
{ | |||
use AdminControllerTrait; | |||
@@ -38,6 +38,7 @@ use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Field\BooleanField; | |||
use Lc\SovBundle\Field\ToggleField; | |||
use Lc\SovBundle\Model\User\UserInterface; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Component\HttpFoundation\Response; | |||
@@ -46,6 +47,10 @@ abstract class UserMerchantAdminController extends AbstractAdminController | |||
use AdminControllerTrait; | |||
public function getRepositoryQuery() :RepositoryQueryInterface | |||
{ | |||
return $this->get(UserMerchantContainer::class)->getRepositoryQuery(); | |||
} | |||
public function overrideEntitiesActions(?EntityCollection $entities): void | |||
{ | |||
$context = $this->get(AdminContextProvider::class)->getContext(); |
@@ -7,6 +7,7 @@ use Doctrine\ORM\QueryBuilder; | |||
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; | |||
use Lc\SovBundle\Field\Filter\AssociationFilter; | |||
use Lc\SovBundle\Field\Filter\FilterTrait; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |||
use Symfony\Component\Form\FormBuilderInterface; | |||
@@ -38,12 +39,10 @@ class ProductCategoriesFilter extends AssociationFilter | |||
} | |||
public function applyFilter(QueryBuilder $queryBuilder, string $fieldProperty, $filteredValue = null) | |||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, string $fieldProperty, $filteredValue = null) | |||
{ | |||
if ($filteredValue !== null) { | |||
$queryBuilder->leftJoin('entity.productCategories', 'product_categories'); | |||
$queryBuilder->andWhere(':' . $fieldProperty . ' MEMBER OF entity.' . $fieldProperty . ' OR product_categories.parent = :' . $fieldProperty); | |||
$queryBuilder->setParameter($fieldProperty, $filteredValue); | |||
$repositoryQuery->filterByProductCategory($filteredValue); | |||
} | |||
} |
@@ -20,7 +20,7 @@ use Lc\SovBundle\Model\File\FileInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class ProductFamilyModel extends AbstractFullEntity implements ProductPropertyInterface, PriceInterface, ProductFamilyInterface | |||
abstract class ProductFamilyModel extends AbstractFullEntity implements ProductPropertyInterface, PriceInterface, ProductFamilyInterface, FilterSectionInterface | |||
{ | |||
use ProductPropertyTrait; | |||
@@ -22,6 +22,7 @@ class OrderProductRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
public function filterByOrderShop(OrderShopInterface $orderShop): self | |||
{ | |||
return $this |
@@ -35,9 +35,9 @@ class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery | |||
return $this; | |||
} | |||
public function filterBySection(SectionInterface $section) | |||
public function filterBySection(SectionInterface $section,bool $addSelectProductFamilySectionProperties = true) | |||
{ | |||
$this->joinProductFamilySectionProperties(); | |||
$this->joinProductFamilySectionProperties($addSelectProductFamilySectionProperties); | |||
$this->andWhereSection('pfsp', $section); | |||
$this->andWhere('pfsp.status = 1'); | |||
} |
@@ -12,6 +12,7 @@ use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
class ProductRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
protected bool $isJoinProductFamily =false; | |||
protected bool $isJoinProductFamilySectionProperties =false; | |||
public function __construct(ProductRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
@@ -35,12 +36,29 @@ class ProductRepositoryQuery extends AbstractRepositoryQuery | |||
} | |||
public function filterBySection(SectionInterface $section):self | |||
{ | |||
$this->joinProductFamilySectionProperties(false); | |||
$this->andWhereSection('pfsp', $section); | |||
$this->andWhere('pfsp.status = 1'); | |||
return $this; | |||
} | |||
public function joinProductFamilySectionProperties(bool $addSelect = true): self | |||
{ | |||
$this->joinProductFamily(); | |||
$this->andWhereSection('pf', $section); | |||
if (!$this->isJoinProductFamilySectionProperties) { | |||
$this->isJoinProductFamilySectionProperties = true; | |||
$this->leftJoin('pf.productFamilySectionProperties', 'pfsp'); | |||
if ($addSelect) { | |||
$this->addSelect('pfsp'); | |||
} | |||
} | |||
return $this; | |||
} | |||
public function filterIsOnline():self | |||
{ | |||
$this->joinProductFamily(); |