<?php

namespace domain\Order\OrderStatus;

use domain\_\AbstractSolver;

class OrderStatusSolver extends AbstractSolver
{
    protected OrderStatusDefinition $orderStatusDefinition;

    public function loadDependencies(): void
    {
        $this->orderStatusDefinition = $this->loadService(OrderStatusDefinition::class);
    }

    public function getLabel(string $orderStatusAlias): string
    {
        $orderStatusArray = $this->orderStatusDefinition->getOrderStatusList();

        if(isset($orderStatusArray[$orderStatusAlias])) {
            return $orderStatusArray[$orderStatusAlias]['label'];
        }
        else {
            return '?';
        }
    }
}