<?php

namespace Saswp\DTOs\Response;

class PropertyTypeDTO
{

    public readonly int $id;

    public readonly string $name;
    public readonly int $active;
    public readonly int $order;

    public function __construct(array $_data)
    {
        $this->id  = isset($_data['id']) ?$_data['id']:0;
        $this->name  = isset($_data['name']) ?$_data['name']:0;
        $this->active  = isset($_data['active']) ?$_data['active']:0;
        $this->order  = isset($_data['order']) ?$_data['order']:0;
    }

    public function toArray(): array
    {
        return (array)$this;
    }
}
