27 lines
691 B
PHP
27 lines
691 B
PHP
<?php
|
|
|
|
namespace Modules\IntegrationHub\Utils;
|
|
|
|
class IntegrationHubUtil
|
|
{
|
|
public static function eventLabel(string $eventKey): string
|
|
{
|
|
if ($eventKey === '*') {
|
|
return __('integrationhub::lang.all_events');
|
|
}
|
|
|
|
$translationKey = 'integrationhub::lang.event_'.str_replace('.', '_', $eventKey);
|
|
$label = __($translationKey);
|
|
|
|
return $label !== $translationKey ? $label : $eventKey;
|
|
}
|
|
|
|
public static function statusLabel(string $status): string
|
|
{
|
|
$translationKey = 'integrationhub::lang.status_'.$status;
|
|
$label = __($translationKey);
|
|
|
|
return $label !== $translationKey ? $label : $status;
|
|
}
|
|
}
|