trafficmonitor/app/DTOs/MylogDTO.php
2025-11-10 16:34:21 +09:00

30 lines
538 B
PHP

<?php
namespace App\DTOs;
class MylogDTO extends CommonDTO
{
public ?int $uid = null;
public ?string $title = null;
public ?string $content = 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 [
'uid' => $this->uid,
'title' => $this->title,
'content' => $this->content,
];
}
}