function EntityBundleExistsConstraint::__construct
Attributes
#[HasNamedArguments]
File
-
core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ EntityBundleExistsConstraint.php, line 36
Class
- EntityBundleExistsConstraint
- Checks if a bundle exists on a certain content entity type.
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintCode
public function __construct(mixed $options = NULL, ?string $entityTypeId = NULL, public $message = "The '@bundle' bundle does not exist on the '@entity_type_id' entity type.", ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
$this->entityTypeId = $entityTypeId ?? $this->entityTypeId;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.