您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

OrderStatusSolver.php 671B

123456789101112131415161718192021222324252627
  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): 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. }