237 lines
8.7 KiB
PHP
Executable File
237 lines
8.7 KiB
PHP
Executable File
<?php
|
|
namespace Zampet\Module\Auth\v0\DTO;
|
|
|
|
class UsuarioDTO {
|
|
private ?int $id = null;
|
|
private ?string $uuid = null;
|
|
private ?string $nome_completo = null;
|
|
private ?int $status_id = 1;
|
|
private ?string $documentcpf = null;
|
|
private ?string $documentcrmv = null;
|
|
private ?string $email = null;
|
|
private ?string $senha = null;
|
|
private ?string $telefone = null;
|
|
private ?string $data_nascimento = null;
|
|
private ?string $endereco_rua = null;
|
|
private ?string $endereco_numero = null;
|
|
private ?string $endereco_complemento = null;
|
|
private ?string $endereco_bairro = null;
|
|
private ?string $endereco_cidade = null;
|
|
private ?string $endereco_uf = null;
|
|
private ?string $endereco_cep = null;
|
|
private ?string $created_at = null;
|
|
private ?string $updated_at = null;
|
|
private ?string $deleted_at = null;
|
|
|
|
/**
|
|
* Construtor do DTO.
|
|
*
|
|
* Permite inicializar os atributos do objeto a partir de um array associativo.
|
|
*
|
|
* @param array<string, mixed> $data Array associativo opcional para popular os atributos.
|
|
*/
|
|
public function __construct(array $data = []) {
|
|
if (!empty($data)) {
|
|
$this->fromArray($data);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Popula o DTO a partir de um array.
|
|
*
|
|
* @param array<string, mixed> $data
|
|
* @return void
|
|
*/
|
|
public function fromArray(array $data): void {
|
|
$this->id = $data['id'] ?? $this->id;
|
|
$this->uuid = $data['uuid'] ?? $this->uuid;
|
|
$this->nome_completo = $data['nome_completo'] ?? $this->nome_completo;
|
|
$this->status_id = $data['status_id'] ?? $this->status_id;
|
|
$this->documentcpf = $data['documentcpf'] ?? $this->documentcpf;
|
|
$this->documentcrmv = $data['documentcrmv'] ?? $this->documentcrmv;
|
|
$this->email = $data['email'] ?? $this->email;
|
|
$this->senha = $data['senha'] ?? $this->senha;
|
|
$this->telefone = $data['telefone'] ?? $this->telefone;
|
|
$this->data_nascimento = $data['data_nascimento'] ?? $this->data_nascimento;
|
|
$this->endereco_rua = $data['endereco_rua'] ?? $this->endereco_rua;
|
|
$this->endereco_numero = $data['endereco_numero'] ?? $this->endereco_numero;
|
|
$this->endereco_complemento = $data['endereco_complemento'] ?? $this->endereco_complemento;
|
|
$this->endereco_bairro = $data['endereco_bairro'] ?? $this->endereco_bairro;
|
|
$this->endereco_cidade = $data['endereco_cidade'] ?? $this->endereco_cidade;
|
|
$this->endereco_uf = $data['endereco_uf'] ?? $this->endereco_uf;
|
|
$this->endereco_cep = $data['endereco_cep'] ?? $this->endereco_cep;
|
|
$this->created_at = $data['created_at'] ?? $this->created_at;
|
|
$this->updated_at = $data['updated_at'] ?? $this->updated_at;
|
|
$this->deleted_at = $data['deleted_at'] ?? $this->deleted_at;
|
|
}
|
|
|
|
/**
|
|
* Converte o DTO para um array associativo.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(): array {
|
|
return [
|
|
'id' => $this->id,
|
|
'uuid' => $this->uuid,
|
|
'nome_completo' => $this->nome_completo,
|
|
'status_id' => $this->status_id,
|
|
'documentcpf' => $this->documentcpf,
|
|
'documentcrmv' => $this->documentcrmv,
|
|
'email' => $this->email,
|
|
'senha' => $this->senha,
|
|
'telefone' => $this->telefone,
|
|
'data_nascimento' => $this->data_nascimento,
|
|
'endereco_rua' => $this->endereco_rua,
|
|
'endereco_numero' => $this->endereco_numero,
|
|
'endereco_complemento' => $this->endereco_complemento,
|
|
'endereco_bairro' => $this->endereco_bairro,
|
|
'endereco_cidade' => $this->endereco_cidade,
|
|
'endereco_uf' => $this->endereco_uf,
|
|
'endereco_cep' => $this->endereco_cep,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
'deleted_at' => $this->deleted_at,
|
|
];
|
|
}
|
|
|
|
public function getId(): ?int {
|
|
return $this->id;
|
|
}
|
|
public function setId(?int $id): void {
|
|
$this->id = $id;
|
|
}
|
|
|
|
public function getUuid(): ?string {
|
|
return $this->uuid;
|
|
}
|
|
public function setUuid(?string $uuid): void {
|
|
$this->uuid = $uuid;
|
|
}
|
|
|
|
public function getNomeCompleto(): ?string {
|
|
return $this->nome_completo;
|
|
}
|
|
public function setNomeCompleto(?string $nome_completo): void {
|
|
$this->nome_completo = $nome_completo;
|
|
}
|
|
|
|
public function getStatusId(): ?int {
|
|
return $this->status_id;
|
|
}
|
|
public function setStatusId(?int $status_id): void {
|
|
$this->status_id = $status_id;
|
|
}
|
|
|
|
public function getDocumentCpf(): ?string {
|
|
return $this->documentcpf;
|
|
}
|
|
public function setDocumentCpf(?string $documentcpf): void {
|
|
$this->documentcpf = $documentcpf;
|
|
}
|
|
|
|
public function getDocumentCrmv(): ?string {
|
|
return $this->documentcrmv;
|
|
}
|
|
public function setDocumentCrmv(?string $documentcrmv): void {
|
|
$this->documentcrmv = $documentcrmv;
|
|
}
|
|
|
|
public function getEmail(): ?string {
|
|
return $this->email;
|
|
}
|
|
public function setEmail(?string $email): void {
|
|
$this->email = $email;
|
|
}
|
|
|
|
public function getSenha(): ?string {
|
|
return $this->senha;
|
|
}
|
|
public function setSenha(?string $senha): void {
|
|
$this->senha = $senha;
|
|
}
|
|
|
|
public function getTelefone(): ?string {
|
|
return $this->telefone;
|
|
}
|
|
public function setTelefone(?string $telefone): void {
|
|
$this->telefone = $telefone;
|
|
}
|
|
|
|
public function getDataNascimento(): ?string {
|
|
return $this->data_nascimento;
|
|
}
|
|
public function setDataNascimento(?string $data_nascimento): void {
|
|
$this->data_nascimento = $data_nascimento;
|
|
}
|
|
|
|
public function getEnderecoRua(): ?string {
|
|
return $this->endereco_rua;
|
|
}
|
|
public function setEnderecoRua(?string $endereco_rua): void {
|
|
$this->endereco_rua = $endereco_rua;
|
|
}
|
|
|
|
public function getEnderecoNumero(): ?string {
|
|
return $this->endereco_numero;
|
|
}
|
|
public function setEnderecoNumero(?string $endereco_numero): void {
|
|
$this->endereco_numero = $endereco_numero;
|
|
}
|
|
|
|
public function getEnderecoComplemento(): ?string {
|
|
return $this->endereco_complemento;
|
|
}
|
|
public function setEnderecoComplemento(?string $endereco_complemento): void {
|
|
$this->endereco_complemento = $endereco_complemento;
|
|
}
|
|
|
|
public function getEnderecoBairro(): ?string {
|
|
return $this->endereco_bairro;
|
|
}
|
|
public function setEnderecoBairro(?string $endereco_bairro): void {
|
|
$this->endereco_bairro = $endereco_bairro;
|
|
}
|
|
|
|
public function getEnderecoCidade(): ?string {
|
|
return $this->endereco_cidade;
|
|
}
|
|
public function setEnderecoCidade(?string $endereco_cidade): void {
|
|
$this->endereco_cidade = $endereco_cidade;
|
|
}
|
|
|
|
public function getEnderecoUf(): ?string {
|
|
return $this->endereco_uf;
|
|
}
|
|
public function setEnderecoUf(?string $endereco_uf): void {
|
|
$this->endereco_uf = $endereco_uf;
|
|
}
|
|
|
|
public function getEnderecoCep(): ?string {
|
|
return $this->endereco_cep;
|
|
}
|
|
public function setEnderecoCep(?string $endereco_cep): void {
|
|
$this->endereco_cep = $endereco_cep;
|
|
}
|
|
|
|
public function getCreatedAt(): ?string {
|
|
return $this->created_at;
|
|
}
|
|
public function setCreatedAt(?string $created_at): void {
|
|
$this->created_at = $created_at;
|
|
}
|
|
|
|
public function getUpdatedAt(): ?string {
|
|
return $this->updated_at;
|
|
}
|
|
public function setUpdatedAt(?string $updated_at): void {
|
|
$this->updated_at = $updated_at;
|
|
}
|
|
|
|
public function getDeletedAt(): ?string {
|
|
return $this->deleted_at;
|
|
}
|
|
public function setDeletedAt(?string $deleted_at): void {
|
|
$this->deleted_at = $deleted_at;
|
|
}
|
|
} |