query = $query; } // getTicketsByUser public function getByUser($user, $query = null): array { if (is_null($query)) { $query = $this->query->create(); } $query->filterByUser($user); return $query->find(); } // findAllOpen public function getAllOpen(int $limit = 0, $query = null): array { if (is_null($query)) { $query = $this->query->create(); } $query ->filterByStatus(Ticket::TICKET_STATUS_OPEN) ->limit($limit) ->orderBy('r.id', 'DESC'); return $query->find(); } //countAllOpen public function countAllOpen($query = null): string { if (is_null($query)) { $query = $this->query->create(); } $query ->selectCount() ->filterByStatus(Ticket::TICKET_STATUS_OPEN); return $query->count(); } }