<?php

namespace Opencart\Extension\Alsendo\DTO\Entity;

class AlsendoRegionEntity
{
    public int $id;
    public string $name;
    public string $code;
    public int $currencyId;
    public int $countryId;
    public bool $active;

    public static function fromArray(array $data): self
    {
        $self = new self();

        $self->id = $data['id'];
        $self->name = $data['name'];
        $self->code = $data['code'];
        $self->countryId = $data['country_id'];
        $self->currencyId = $data['currency_id'];
        $self->active = $data['active'];

        return $self;
    }
}