本文整理汇总了PHP中Symfony\Component\Validator\Constraint::addImplicitGroupName方法的典型用法代码示例。如果您正苦于以下问题:PHP Constraint::addImplicitGroupName方法的具体用法?PHP Constraint::addImplicitGroupName怎么用?PHP Constraint::addImplicitGroupName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Validator\Constraint
的用法示例。
在下文中一共展示了Constraint::addImplicitGroupName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addGetterConstraint
/**
* 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;
}
示例2: addImplicitGroupName
/**
* {@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);
}
}