function BundleConstraint::__construct
Attributes
#[HasNamedArguments]
File
-
core/
lib/ Drupal/ Core/ Entity/ Plugin/ Validation/ Constraint/ BundleConstraint.php, line 30
Class
- BundleConstraint
- Checks if a value is a valid entity type.
Namespace
Drupal\Core\Entity\Plugin\Validation\ConstraintCode
public function __construct(mixed $options = NULL, string|array|null $bundle = NULL, public $message = 'The entity must be of bundle %bundle.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
$this->bundle = $bundle ?? $this->bundle;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.