You are here

public function GenericMetadata::__clone in Plug 7

Clones this object.

File

lib/Symfony/validator/Symfony/Component/Validator/Mapping/GenericMetadata.php, line 97

Class

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

Namespace

Symfony\Component\Validator\Mapping

Code

public function __clone() {
  $constraints = $this->constraints;
  $this->constraints = array();
  $this->constraintsByGroup = array();
  foreach ($constraints as $constraint) {
    $this
      ->addConstraint(clone $constraint);
  }
}