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

@@ -25,6 +25,15 @@ class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery
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
{
if (!$this->isJoinProductFamilySectionProperties) {
@@ -178,7 +187,8 @@ class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery

$this->innerJoin('.products', 'products');
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;

Loading…
Cancel
Save