Browse Source

Refactoring repositoryQuery id d'entité

packProduct
Fabien Normand 3 years ago
parent
commit
7148f7ebf5
1 changed files with 11 additions and 9 deletions
  1. +11
    -9
      Repository/Reduction/ReductionCatalogRepositoryQuery.php

+ 11
- 9
Repository/Reduction/ReductionCatalogRepositoryQuery.php View File

$this->isJoinGroupUsers = true; $this->isJoinGroupUsers = true;


return $this return $this
->leftJoin('.groupUsers', 'pf_groupusers')
->addSelect('pf_groupusers') ;
->leftJoin('.groupUsers', 'groupUsers')
->addSelect('groupUsers') ;
} }
return $this; return $this;
} }
$this->isJoinProductFamilies = true; $this->isJoinProductFamilies = true;


return $this return $this
->leftJoin('.productFamilies', 'pfs')
->addSelect('pfs') ;
->leftJoin('.productFamilies', 'productFamilies')
->addSelect('productFamilies') ;
} }
return $this; return $this;
} }
$this->isJoinProductFamily = true; $this->isJoinProductFamily = true;


return $this return $this
->leftJoin('.productFamily', 'pf')
->addSelect('pf') ;
->leftJoin('.productFamily', 'productFamily')
->addSelect('productFamily') ;
} }

return $this; return $this;
} }


$this->isJoinProductCategories = true; $this->isJoinProductCategories = true;


return $this return $this
->leftJoin('.productCategories', 'pcs')
->addSelect('pcs') ;
->leftJoin('.productCategories', 'productCategories')
->addSelect('productCategories') ;
} }

return $this; return $this;
} }


$this->joinProductFamily(); $this->joinProductFamily();


return $this return $this
->andWhere(':productFamily MEMBER OF .productFamilies OR .productFamilies is empty')
->andWhere(':productFamily MEMBER OF .productFamily OR .productFamily is empty')
->setParameter('productFamily', $productFamily); ->setParameter('productFamily', $productFamily);
} }



Loading…
Cancel
Save