|
|
@@ -42,7 +42,7 @@ class ProductCategoryRepository extends BaseRepository implements DefaultReposit |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public function findAllByParent($parentCategory, $withOffline = false) |
|
|
|
public function findAllByParent($parentCategory, $withOffline = false, $withEmptyCategories = true) |
|
|
|
{ |
|
|
|
$query = $this->createQueryBuilder('e'); |
|
|
|
$query->andWhere('e.parent = :idParentCategory'); |
|
|
@@ -50,6 +50,11 @@ class ProductCategoryRepository extends BaseRepository implements DefaultReposit |
|
|
|
if ($withOffline) $query->andWhere('e.status >= 0'); |
|
|
|
else $query->andWhere('e.status = 1'); |
|
|
|
|
|
|
|
if(!$withEmptyCategories) { |
|
|
|
$query->innerJoin('e.productFamilies','pf') ; |
|
|
|
$query->andWhere('pf.status = 1') ; |
|
|
|
} |
|
|
|
|
|
|
|
$query->setParameter('idParentCategory', $parentCategory->getId()); |
|
|
|
return $query->getQuery()->getResult(); |
|
|
|
} |