28 lines
473 B
PHP
28 lines
473 B
PHP
<?php
|
|
|
|
namespace App\DTOs\Auth;
|
|
|
|
class LocalDTO extends AuthDTO
|
|
{
|
|
public ?string $id = null;
|
|
public ?string $passwd = null;
|
|
|
|
public function __construct(array $datas = [])
|
|
{
|
|
parent::__construct();
|
|
foreach ($datas as $key => $value) {
|
|
if (property_exists($this, $key)) {
|
|
$this->{$key} = $value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'passwd' => $this->passwd,
|
|
];
|
|
}
|
|
}
|