You are here

public function GenericMetadata::addConstraints in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Mapping/GenericMetadata.php \Symfony\Component\Validator\Mapping\GenericMetadata::addConstraints()

Adds an list of constraints.

Parameters

Constraint[] $constraints The constraints to add:

Return value

GenericMetadata This object

File

vendor/symfony/validator/Mapping/GenericMetadata.php, line 174

Class

GenericMetadata
A generic container of {@link Constraint} objects.

Namespace

Symfony\Component\Validator\Mapping

Code

public function addConstraints(array $constraints) {
  foreach ($constraints as $constraint) {
    $this
      ->addConstraint($constraint);
  }
  return $this;
}