36 lines
740 B
PHP
36 lines
740 B
PHP
<?php
|
|
|
|
namespace App\DTOs;
|
|
|
|
class CollectorDTO extends CommonDTO
|
|
{
|
|
public ?int $uid = null;
|
|
public ?int $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,
|
|
];
|
|
}
|
|
}
|