protected $image; | protected $image; | ||||
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\QualityLabelInterface", fetch="EAGER") | |||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\QualityLabelInterface", fetch="LAZY") | |||||
*/ | */ | ||||
protected $qualityLabels; | protected $qualityLabels; | ||||
public function addFilterByMerchantViaSectionRequired(RepositoryQueryInterface $query): StoreInterface | public function addFilterByMerchantViaSectionRequired(RepositoryQueryInterface $query): StoreInterface | ||||
{ | { | ||||
$this->addFilterByMerchantOptionnal($query); | |||||
$this->addFilterByMerchantViaSectionOptionnal($query); | |||||
if(!$this->isMerchantDefined()) { | if(!$this->isMerchantDefined()) { | ||||
throw new \ErrorException('Le Merchant doit être définie dans '.get_class($this)); | throw new \ErrorException('Le Merchant doit être définie dans '.get_class($this)); |
->groupBy('distribution.cycleNumber, product.id'); | ->groupBy('distribution.cycleNumber, product.id'); | ||||
//TODO vérifier ou est utilisé cette fonction ??? | //TODO vérifier ou est utilisé cette fonction ??? | ||||
dump($query->find()); | |||||
return $query->find(); | return $query->find(); | ||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
public function filterBySection(SectionInterface $section): self | public function filterBySection(SectionInterface $section): self | ||||
{ | { | ||||
$this->joinProductFamilySectionProperties(false); | $this->joinProductFamilySectionProperties(false); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function filterIsOnlineAndOffline(): self | |||||
{ | |||||
$this->joinProductFamily(); | |||||
$this->andWhere('productFamily.status >= 0'); | |||||
$this->andWhere('.status >=0'); | |||||
return $this; | |||||
} | |||||
public function filterIsOnSale(): self | public function filterIsOnSale(): self | ||||
{ | { | ||||
$this->joinProductFamily(); | $this->joinProductFamily(); |
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
} | } |