|
|
|
@ -12,17 +12,20 @@ class EmpresaModel implements IModel
|
|
|
|
|
public string $nome; |
|
|
|
|
public string $email; |
|
|
|
|
public string $cnpj; |
|
|
|
|
public string $token; |
|
|
|
|
|
|
|
|
|
function __construct( |
|
|
|
|
$id = null, |
|
|
|
|
$nome, |
|
|
|
|
$email, |
|
|
|
|
$cnpj |
|
|
|
|
?int $id, |
|
|
|
|
string $nome, |
|
|
|
|
string $email, |
|
|
|
|
string $cnpj, |
|
|
|
|
string $token |
|
|
|
|
) { |
|
|
|
|
$this->id = $id; |
|
|
|
|
$this->nome = $nome; |
|
|
|
|
$this->email = $email; |
|
|
|
|
$this->cnpj = $cnpj; |
|
|
|
|
$this->token = $token; |
|
|
|
|
} |
|
|
|
|
function toArray(): array |
|
|
|
|
{ |
|
|
|
@ -30,7 +33,8 @@ class EmpresaModel implements IModel
|
|
|
|
|
'nome' => $this->nome, |
|
|
|
|
'id' => $this->id, |
|
|
|
|
'email' => $this->email, |
|
|
|
|
'cnpj' => $this->cnpj |
|
|
|
|
'cnpj' => $this->cnpj, |
|
|
|
|
'token' => $this->token |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
static function ArrayTo(array $params): self |
|
|
|
@ -39,7 +43,8 @@ class EmpresaModel implements IModel
|
|
|
|
|
id: $params['id'], |
|
|
|
|
nome: $params['nome'], |
|
|
|
|
email: $params['email'], |
|
|
|
|
cnpj: $params['cnpj'] |
|
|
|
|
cnpj: $params['cnpj'], |
|
|
|
|
token: $params['token'] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |