瀏覽代碼

Modif ProductFamilyRepositoryQuery.php

packProduct
Guillaume 3 年之前
父節點
當前提交
78d8b35a26
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. +11
    -1
      Repository/Product/ProductFamilyRepositoryQuery.php

+ 11
- 1
Repository/Product/ProductFamilyRepositoryQuery.php 查看文件

@@ -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…
取消
儲存