MetaModels\DcGeneral\Events\Table\InputScreenCondition\Subscriber::getLabelText PHP Метод

getLabelText() публичный Метод

Retrieve the label text for a condition setting or the default one.
public getLabelText ( ContaoCommunityAlliance\Translator\TranslatorInterface $translator, string $type ) : string
$translator ContaoCommunityAlliance\Translator\TranslatorInterface The environment in use.
$type string The type of the element.
Результат string
    public function getLabelText(TranslatorInterface $translator, $type)
    {
        $label = $translator->translate('typedesc.' . $type, 'tl_metamodel_dcasetting_condition');
        if ($label == 'typedesc.' . $type) {
            $label = $translator->translate('typedesc._default_', 'tl_metamodel_dcasetting_condition');
            if ($label == 'typedesc._default_') {
                return $type;
            }
        }
        return $label;
    }