function EntityHasFieldConstraint::__construct
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityHasFieldConstraint.php \Drupal\Core\Entity\Plugin\Validation\Constraint\EntityHasFieldConstraint::__construct()
File
-
core/
lib/ Drupal/ Core/ Entity/ Plugin/ Validation/ Constraint/ EntityHasFieldConstraint.php, line 19
Class
- EntityHasFieldConstraint
- Checks if a value is an entity that has a specific field.
Namespace
Drupal\Core\Entity\Plugin\Validation\ConstraintCode
public function __construct(public string $field_name, public $message = 'The entity must have the %field_name field.', public $notFieldableMessage = 'The entity does not support fields.', ?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.