class LangcodeRequiredIfTranslatableValuesConstraint
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/LangcodeRequiredIfTranslatableValuesConstraint.php \Drupal\Core\Config\Plugin\Validation\Constraint\LangcodeRequiredIfTranslatableValuesConstraint
- 10 core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/LangcodeRequiredIfTranslatableValuesConstraint.php \Drupal\Core\Config\Plugin\Validation\Constraint\LangcodeRequiredIfTranslatableValuesConstraint
Validation constraint for translatable configuration.
Attributes
#[Constraint(id: 'LangcodeRequiredIfTranslatableValues', label: new TranslatableMarkup('Translatable config has langcode', [], [
'context' => 'Validation',
]), type: [
'config_object',
])]
Hierarchy
- class \Drupal\Core\Config\Plugin\Validation\Constraint\LangcodeRequiredIfTranslatableValuesConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of LangcodeRequiredIfTranslatableValuesConstraint
File
-
core/
lib/ Drupal/ Core/ Config/ Plugin/ Validation/ Constraint/ LangcodeRequiredIfTranslatableValuesConstraint.php, line 15
Namespace
Drupal\Core\Config\Plugin\Validation\ConstraintView source
class LangcodeRequiredIfTranslatableValuesConstraint extends SymfonyConstraint {
public function __construct(mixed $options = NULL, public string $missingMessage = "The @name config object must specify a language code, because it contains translatable values.", public string $superfluousMessage = "The @name config object does not contain any translatable values, so it should not specify a language code.", ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| LangcodeRequiredIfTranslatableValuesConstraint::__construct | public | function | #[HasNamedArguments] |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.