class RequiredConfigDependenciesConstraint
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php \Drupal\Core\Config\Plugin\Validation\Constraint\RequiredConfigDependenciesConstraint
- 10 core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php \Drupal\Core\Config\Plugin\Validation\Constraint\RequiredConfigDependenciesConstraint
Checks that config dependencies contain specific types of entities.
Attributes
#[Constraint(id: 'RequiredConfigDependencies', label: new TranslatableMarkup('Required config dependency types', [], [
'context' => 'Validation',
]))]
Hierarchy
- class \Drupal\Core\Config\Plugin\Validation\Constraint\RequiredConfigDependenciesConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of RequiredConfigDependenciesConstraint
File
-
core/
lib/ Drupal/ Core/ Config/ Plugin/ Validation/ Constraint/ RequiredConfigDependenciesConstraint.php, line 14
Namespace
Drupal\Core\Config\Plugin\Validation\ConstraintView source
class RequiredConfigDependenciesConstraint extends SymfonyConstraint {
/**
* Constructs a RequiredConfigDependenciesConstraint object.
*
* @param array $entityTypes
* The IDs of entity types that need to exist in config dependencies. For
* example, if an entity requires a filter format in its config
* dependencies, this should contain `filter_format`.
* @param string $message
* The error message.
* @param array|null $groups
* The groups that the constraint belongs to.
* @param mixed|null $payload
* Domain-specific data attached to a constraint.
*/
public function __construct(public array $entityTypes = [], public string $message = 'This @entity_type requires a @dependency_type.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct(groups: $groups, payload: $payload);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| RequiredConfigDependenciesConstraint::__construct | public | function | Constructs a RequiredConfigDependenciesConstraint object. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.