<?php

namespace Saswp\DTOs\Response;

class PropertyBasicInformationDTO
{

    public readonly int $id;
    public readonly PropertyTypeDTO $property_type;
    public readonly PropertyRestrictionDTO $property_restriction;
    public function __construct(array $_data)
    {
        $this->id  = isset($_data['id']) ?$_data['id']:0;
        $this->property_restriction  = new PropertyRestrictionDTO((isset($_data['property_restrictions']) ?$_data['property_restrictions']:[]));
        $this->property_type  = new PropertyTypeDTO((isset($_data['property_type']) ?$_data['property_type']:[]));
    }

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