trafficmonitor/app/DTOs/CollectorDTO.php
2025-11-11 08:52:20 +09:00

36 lines
743 B
PHP

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