You are here

public function ClassMetadata::setGroupSequenceProvider in Zircon Profile 8

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

Sets whether a group sequence provider should be used.

Parameters

bool $active:

Throws

GroupDefinitionException

File

vendor/symfony/validator/Mapping/ClassMetadata.php, line 514

Class

ClassMetadata
Default implementation of {@link ClassMetadataInterface}.

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;
}