public function ClassMetadata::setGroupSequenceProvider

Sets whether a group sequence provider should be used.

Parameters

Boolean $active:

Throws

GroupDefinitionException

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/ClassMetadata.php, line 399

Class

ClassMetadata
Represents all the configured constraints on a given class.

Namespace

Symfony\Component\Validator\Mapping

Code

public function setGroupSequenceProvider($active) {
  if ($this
    ->hasGroupSequence()) {
    throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence');
  }
  if (!$this
    ->getReflectionClass()
    ->implementsInterface('Symfony\\Component\\Validator\\GroupSequenceProviderInterface')) {
    throw new GroupDefinitionException(sprintf('Class "%s" must implement GroupSequenceProviderInterface', $this->name));
  }
  $this->groupSequenceProvider = $active;
}