function FieldStorageDefinitionInterface::getConstraint

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php \Drupal\Core\Field\FieldStorageDefinitionInterface::getConstraint()
  2. 8.9.x core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php \Drupal\Core\Field\FieldStorageDefinitionInterface::getConstraint()
  3. 11.x core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php \Drupal\Core\Field\FieldStorageDefinitionInterface::getConstraint()

Returns a validation constraint.

See \Drupal\Core\TypedData\DataDefinitionInterface::getConstraints() for details.

Parameters

string $constraint_name: The name of the constraint, i.e. its plugin id.

Return value

array A validation constraint definition which can be used for instantiating a \Symfony\Component\Validator\Constraint object.

See also

\Symfony\Component\Validator\Constraint

1 method overrides FieldStorageDefinitionInterface::getConstraint()
FieldStorageConfig::getConstraint in core/modules/field/src/Entity/FieldStorageConfig.php
Returns a validation constraint.

File

core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php, line 291

Class

FieldStorageDefinitionInterface
Defines an interface for entity field storage definitions.

Namespace

Drupal\Core\Field

Code

public function getConstraint($constraint_name);

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