'Не используется', self::STATUS_ACTIVE => 'Активен', self::STATUS_COMPLETED => 'Завершён', self::STATUS_ON_INSPECTION => 'На проверке' ]; } /** * @throws Exception */ public static function statusName($status): string { return ArrayHelper::getValue(self::statusList(), $status); } /** * @throws Exception */ public static function statusLabel($status): string { switch ($status) { case self::STATUS_PASSIVE: $class = 'label label-danger'; break; case ($status === self::STATUS_ACTIVE or $status === self::STATUS_COMPLETED): $class = 'label label-success'; break; default: $class = 'label label-default'; } return Html::tag('span', ArrayHelper::getValue(self::statusList(), $status), [ 'class' => $class, ]); } }