You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
678B

  1. <?php
  2. namespace domain\Order\OrderStatus;
  3. use domain\_\AbstractSolver;
  4. class OrderStatusSolver extends AbstractSolver
  5. {
  6. protected OrderStatusDefinition $orderStatusDefinition;
  7. public function loadDependencies(): void
  8. {
  9. $this->orderStatusDefinition = $this->loadService(OrderStatusDefinition::class);
  10. }
  11. public function getLabel(string $orderStatusAlias = null): string
  12. {
  13. $orderStatusArray = $this->orderStatusDefinition->getOrderStatusList();
  14. if(isset($orderStatusArray[$orderStatusAlias])) {
  15. return $orderStatusArray[$orderStatusAlias]['label'];
  16. }
  17. else {
  18. return '?';
  19. }
  20. }
  21. }