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