Browse Source

Add attribute token in empresa

main
lucas cardoso 2 years ago
parent
commit
26cc7f9fd1
  1. 17
      app/Models/EmpresaModel.php

17
app/Models/EmpresaModel.php

@ -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']
);
}
}
Loading…
Cancel
Save