You are here

public function BarcodeBase::getConstraints in Barcode 8

Gets a list of validation constraints.

Return value

array Array of constraints, each being an instance of \Symfony\Component\Validator\Constraint.

Overrides TypedData::getConstraints

File

src/Plugin/Field/FieldType/BarcodeBase.php, line 81

Class

BarcodeBase

Namespace

Drupal\barcode\Plugin\Field\FieldType

Code

public function getConstraints() {
  $constraints = parent::getConstraints();

  /*$constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();

      // @DCG Suppose our value must not be longer than 10 characters.
      $options['value']['Length']['max' = 10;

      // @DCG
      // See /core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint
      // directory for available constraints.
      $constraints[] = $constraint_manager->create('ComplexData', $options);
      */
  return $constraints;
}