Browse Source

Modif ProductFamilyRepositoryQuery.php

packProduct
Guillaume 3 years ago
parent
commit
78d8b35a26
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      Repository/Product/ProductFamilyRepositoryQuery.php

+ 11
- 1
Repository/Product/ProductFamilyRepositoryQuery.php View File

parent::__construct($repository, 'productFamily', $paginator); parent::__construct($repository, 'productFamily', $paginator);
} }


public function resetRelationsJoin(): void
{
$this->isJoinSections = false;
$this->isJoinProductCategories = false;
$this->isJoinProductFamilySectionProperties = false;
$this->isJoinProducts = false;
$this->isJoinQualityLabels = false;
}

public function joinProductFamilySectionProperties(bool $addSelect = true): self public function joinProductFamilySectionProperties(bool $addSelect = true): self
{ {
if (!$this->isJoinProductFamilySectionProperties) { if (!$this->isJoinProductFamilySectionProperties) {


$this->innerJoin('.products', 'products'); $this->innerJoin('.products', 'products');
if ($addSelect) { if ($addSelect) {
$this->addSelect('products');
// Décommenté sinon doctrine n'hydrate pas correctement les produits liés au ProductFamily (exemple : un seul sur deux)
// $this->addSelect('products');
} }
} }
return $this; return $this;

Loading…
Cancel
Save