Browse Source

Correctif ReductionCatalogRepositoryQuery

packProduct
Guillaume 3 years ago
parent
commit
a43bff542e
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      Repository/Reduction/ReductionCatalogRepositoryQuery.php

+ 7
- 5
Repository/Reduction/ReductionCatalogRepositoryQuery.php View File

$this->isJoinGroupUsers = true; $this->isJoinGroupUsers = true;


return $this return $this
->leftJoin('.groupUsers', 'groupusers')
->addSelect('groupusers') ;
->leftJoin('.groupUsers', 'groupUsers')
->addSelect('groupUsers') ;
} }
return $this; return $this;
} }
->leftJoin('.productFamily', 'productFamily') ->leftJoin('.productFamily', 'productFamily')
->addSelect('productFamily') ; ->addSelect('productFamily') ;
} }

return $this; return $this;
} }


->leftJoin('.productCategories', 'productCategories') ->leftJoin('.productCategories', 'productCategories')
->addSelect('productCategories') ; ->addSelect('productCategories') ;
} }

return $this; return $this;
} }


public function filterConditionProductFamilies(array $productFamilies) public function filterConditionProductFamilies(array $productFamilies)
{ {
$this->joinProductFamilies(); $this->joinProductFamilies();
$this->joinProductFamily();


return $this return $this
->andWhere(':productFamilies MEMBER OF .productFamilies OR .productFamilies is empty') ->andWhere(':productFamilies MEMBER OF .productFamilies OR .productFamilies is empty')
->setParameter('productFamilies', $productFamilies); ->setParameter('productFamilies', $productFamilies);

return $this;
} }


public function filterConditionProductFamily(ProductFamilyInterface $productFamily) public function filterConditionProductFamily(ProductFamilyInterface $productFamily)
{ {
$this->joinProductFamilies();
$this->joinProductFamily(); $this->joinProductFamily();


return $this return $this
->andWhere(':productFamily MEMBER OF .productFamilies OR .productFamilies is empty')
->andWhere(':productFamily MEMBER OF .productFamily OR .productFamily is empty')
->setParameter('productFamily', $productFamily); ->setParameter('productFamily', $productFamily);
} }



Loading…
Cancel
Save