function RequiredConfigDependenciesConstraint::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php \Drupal\Core\Config\Plugin\Validation\Constraint\RequiredConfigDependenciesConstraint::__construct()

Constructs a RequiredConfigDependenciesConstraint object.

Parameters

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`.

string $message: The error message.

array|null $groups: The groups that the constraint belongs to.

mixed|null $payload: Domain-specific data attached to a constraint.

File

core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php, line 34

Class

RequiredConfigDependenciesConstraint
Checks that config dependencies contain specific types of entities.

Namespace

Drupal\Core\Config\Plugin\Validation\Constraint

Code

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.