trafficmonitor/app/DTOs/MylogDTO.php
2025-11-18 10:47:20 +09:00

34 lines
680 B
PHP

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