public DataDefinition::getConstraint($constraint_name)
Returns a validation constraint.
See \Drupal\Core\TypedData\DataDefinitionInterface::getConstraints() for details.
string $constraint_name: The name of the constraint, i.e. its plugin id.
array A validation constraint definition which can be used for instantiating a \Symfony\Component\Validator\Constraint object.
Overrides DataDefinitionInterface::getConstraint
\Symfony\Component\Validator\Constraint
public function getConstraint($constraint_name) { $constraints = $this->getConstraints(); return isset($constraints[$constraint_name]) ? $constraints[$constraint_name] : NULL; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!DataDefinition.php/function/DataDefinition::getConstraint/8.1.x