|
|
|
|
|
|
|
|
return $query->getQuery()->getResult(); |
|
|
return $query->getQuery()->getResult(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function findAllByParent($parentCategory, $withOffline = false, $withEmptyCategories = true) |
|
|
|
|
|
|
|
|
public function findAllByParent($parentCategory, $withOffline = false, $withEmptyCategories = true, $filterBySpecificDay = false) |
|
|
{ |
|
|
{ |
|
|
$query = $this->createQueryBuilder('e'); |
|
|
$query = $this->createQueryBuilder('e'); |
|
|
$query->andWhere('e.parent = :idParentCategory'); |
|
|
$query->andWhere('e.parent = :idParentCategory'); |
|
|
|
|
|
|
|
|
$query->andWhere('pf.status = 1') ; |
|
|
$query->andWhere('pf.status = 1') ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$query->andWhere('e.displaySpecificDay IS NULL OR e.displaySpecificDay = :dayToday') ; |
|
|
|
|
|
$query->setParameter('dayToday', date('N')) ; |
|
|
|
|
|
|
|
|
if($filterBySpecificDay) { |
|
|
|
|
|
$query->andWhere('e.displaySpecificDay IS NULL OR e.displaySpecificDay = :dayToday') ; |
|
|
|
|
|
$query->setParameter('dayToday', date('N')) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$query->addOrderBy('e.position', 'ASC') ; |
|
|
$query->addOrderBy('e.position', 'ASC') ; |
|
|
|
|
|
|