<?php

namespace Saswp\DTOs\Response;

class PropertyRestrictionDTO
{

    public readonly int $id;

    public readonly int $availability;
    public readonly int $maximum_guests;
    public readonly int $maximum_pets;

    public function __construct(array $_data)
    {
        $this->id  = isset($_data['id']) ?$_data['id']:0;
        $this->availability  = isset($_data['availability']) ?$_data['availability']:0;
        $this->maximum_guests  = isset($_data['maximum_guests']) ?$_data['maximum_guests']:0;
        $this->maximum_pets  = isset($_data['maximum_pets']) ?$_data['maximum_pets']:0;
    }

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