|
|
|
@ -11,4 +11,23 @@ class EmpresaRepository extends Repository
|
|
|
|
|
{ |
|
|
|
|
$this->table = EmpresaModel::$table; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function list(array $params = []): array |
|
|
|
|
{ |
|
|
|
|
$table = EmpresaModel::$table; |
|
|
|
|
$query = "SELECT * FROM $table WHERE 1=1"; |
|
|
|
|
|
|
|
|
|
if ($params['token']) { |
|
|
|
|
$query .= " AND token = :token "; |
|
|
|
|
$dados['token'] = $params['token']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($params['id']) { |
|
|
|
|
$query .= " AND id = :id "; |
|
|
|
|
$dados['id'] = $params['id']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->db->read($query, $dados)->fetchAll(); |
|
|
|
|
} |
|
|
|
|
} |