|
|
|
|
|
|
|
|
return $this; |
|
|
return $this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function addOrderBy($field, $direction ='ASC') : self |
|
|
|
|
|
{ |
|
|
|
|
|
$this->queryBuilderParameters['orderBy'][] = $field; |
|
|
|
|
|
$this->queryBuilderParameters['orderByDirection'][] = $direction; |
|
|
|
|
|
|
|
|
|
|
|
return $this; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function initQueryBuilder(): self |
|
|
public function initQueryBuilder(): self |
|
|
{ |
|
|
{ |
|
|
$param = $this->queryBuilderParameters; |
|
|
$param = $this->queryBuilderParameters; |
|
|
|
|
|
|
|
|
$qb->andWhere('e.status = :status')->setParameter('status', $param['status']); |
|
|
$qb->andWhere('e.status = :status')->setParameter('status', $param['status']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$qb->orderBy('e.position', 'ASC'); |
|
|
|
|
|
|
|
|
if (isset($param['orderBy'])) { |
|
|
|
|
|
foreach ($param['orderBy'] as $i=>$field) { |
|
|
|
|
|
$qb->addOrderBy('e.'.$param['orderBy'][$i], $param['orderByDirection'][$i]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/*if (isset($param['devAlias'])) { |
|
|
/*if (isset($param['devAlias'])) { |
|
|
$qb->andWhere('e.devAlias = :devAlias')->setParameter( |
|
|
$qb->andWhere('e.devAlias = :devAlias')->setParameter( |