<?php
declare(strict_types=1);

namespace Simplyin\Simplyin_W_Plugin\Controller\Ajax\Widget;

use Simplyin\Simplyin_W_Plugin\Controller\Ajax\Abstract_Response;

class Select_Address_Response extends Abstract_Response {
    protected array $warnings = [];
    protected bool  $redirect = false;
    protected array $data     = [];

    public function get_array(): array {
        return array_merge(
            [
                'warnings' => $this->warnings,
                'redirect' => $this->redirect,
            ],
            $this->data
        );
    }

    public function set_warnings(array $warnings): void {
        $this->warnings = $warnings;
    }

    public function set_redirect(bool $flag): void {
        $this->redirect = $flag;
    }

    public function set_data(array $data): void {
        $this->data = $data;
    }
}
