query = "SELECT id, nome FROM " . self::TABLE . " WHERE 1=1 AND midiafila = :midiafila "; if ($active) { $this->query .= " AND status = :status "; $data['status'] = 'A'; } $data['midiafila'] = "S"; $this->query .= " ORDER BY nome LIMIT 10 "; return $this->read($this->query, $data)->fetchAll(); } public function findQueueByName($nome, $active = true) { $this->query = "SELECT * FROM " . self::TABLE . " WHERE nome = :nome "; if ($active) { $this->query .= " AND status = :status "; $data['status'] = 'A'; } $data['nome'] = $nome; return $this->read($this->query, $data)->fetch(); } public function findQueueById($id, $active = true) { $this->query = "SELECT * FROM " . self::TABLE . " WHERE id = :id "; if ($active) { $this->query .= " AND status = :status "; $data['status'] = 'A'; } $data['id'] = $id; return $this->read($this->query, $data)->fetch(); } }