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

32 lines
616 B
PHP

<?php
namespace App\DTOs;
class CollectorDTO extends CommonDTO
{
public ?int $uid = null;
public ?string $trafficinfo_uid = null;
public ?string $in = null;
public ?string $out = 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,
'trafficinfo_uid' => $this->trafficinfo_uid,
'in' => $this->in,
'out' => $this->out,
];
}
}