当前位置: 首页>>代码示例>>PHP>>正文


PHP Constraint::addImplicitGroupName方法代码示例

本文整理汇总了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;
 }
开发者ID:gr-thao,项目名称:jobeet,代码行数:21,代码来源:ClassMetadata.php

示例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);
     }
 }
开发者ID:neteasy-work,项目名称:hkgbf_crm,代码行数:16,代码来源:Composite.php


注:本文中的Symfony\Component\Validator\Constraint::addImplicitGroupName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。