Przeglądaj źródła

Refactoring repositoryQuery id d'entité

packProduct
Fabien Normand 3 lat temu
rodzic
commit
f86c5b13b3
1 zmienionych plików z 11 dodań i 13 usunięć
  1. +11
    -13
      Repository/Reduction/ReductionCatalogRepositoryQuery.php

+ 11
- 13
Repository/Reduction/ReductionCatalogRepositoryQuery.php Wyświetl plik

@@ -21,7 +21,7 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery

public function __construct(ReductionCatalogRepository $repository, PaginatorInterface $paginator)
{
parent::__construct($repository, 'reductionCatalog', $paginator);
parent::__construct($repository, 'r', $paginator);
}

public function joinUsers()
@@ -30,8 +30,8 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
$this->isJoinUsers = true;

return $this
->leftJoin('.users', 'users')
->addSelect('users') ;
->leftJoin('.users', 'pf_users')
->addSelect('pf_users') ;
}
return $this;
}
@@ -42,8 +42,8 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
$this->isJoinGroupUsers = true;

return $this
->leftJoin('.groupUsers', 'groupusers')
->addSelect('groupusers') ;
->leftJoin('.groupUsers', 'pf_groupusers')
->addSelect('pf_groupusers') ;
}
return $this;
}
@@ -54,8 +54,8 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
$this->isJoinProductFamilies = true;

return $this
->leftJoin('.productFamilies', 'productFamilies')
->addSelect('productFamilies') ;
->leftJoin('.productFamilies', 'pfs')
->addSelect('pfs') ;
}
return $this;
}
@@ -66,8 +66,8 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
$this->isJoinProductFamily = true;

return $this
->leftJoin('.productFamily', 'productFamily')
->addSelect('productFamily') ;
->leftJoin('.productFamily', 'pf')
->addSelect('pf') ;
}
return $this;
}
@@ -78,8 +78,8 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
$this->isJoinProductCategories = true;

return $this
->leftJoin('.productCategories', 'productCategories')
->addSelect('productCategories') ;
->leftJoin('.productCategories', 'pcs')
->addSelect('pcs') ;
}
return $this;
}
@@ -129,7 +129,6 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
public function filterConditionProductFamilies(array $productFamilies)
{
$this->joinProductFamilies();
$this->joinProductFamily();

return $this
->andWhere(':productFamilies MEMBER OF .productFamilies OR .productFamilies is empty')
@@ -138,7 +137,6 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery

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

return $this

Ładowanie…
Anuluj
Zapisz