andWhere('e.status IN (:status)')->setParameter('status', $statusArray) ; return $query ; } public function findAllOpen($limit=0) { $query = $this->findByMerchantQuery() ; $this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]) ; $query->addOrderBy('e.id', 'DESC') ; $query->setMaxResults($limit); return $query->getQuery()->getResult() ; } public function countAllOpen() { $query = $this->findByMerchantQuery() ; $query->select('count(e.id)'); $this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]) ; return $query->getQuery()->getSingleScalarResult() ; } }