addImplicitGroupName() public method

Adds the given group if this constraint is in the Default group
public addImplicitGroupName ( string $group )
$group string
Example #1
0
 /**
  * Adds a constraint to the getter of the given property.
  *
  * The name of the getter is assumed to be the name of the property with an
  * uppercased first letter and either the prefix "get" or "is".
  *
  * @param string     $property   The name of the property
  * @param Constraint $constraint The constraint
  *
  * @return ClassMetadata This object
  */
 public function addGetterConstraint($property, Constraint $constraint)
 {
     if (!isset($this->getters[$property])) {
         $this->getters[$property] = new GetterMetadata($this->getClassName(), $property);
         $this->addMemberMetadata($this->getters[$property]);
     }
     $constraint->addImplicitGroupName($this->getDefaultGroup());
     $this->getters[$property]->addConstraint($constraint);
     return $this;
 }
Example #2
0
 /**
  * {@inheritdoc}
  *
  * Implicit group names are forwarded to nested constraints.
  *
  * @param string $group
  */
 public function addImplicitGroupName($group)
 {
     parent::addImplicitGroupName($group);
     /** @var Constraint[] $nestedConstraints */
     $nestedConstraints = $this->{$this->getCompositeOption()};
     foreach ($nestedConstraints as $constraint) {
         $constraint->addImplicitGroupName($group);
     }
 }