當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ClassMetadata::getMemberMetadatas方法代碼示例

本文整理匯總了PHP中Symfony\Component\Validator\Mapping\ClassMetadata::getMemberMetadatas方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadata::getMemberMetadatas方法的具體用法?PHP ClassMetadata::getMemberMetadatas怎麽用?PHP ClassMetadata::getMemberMetadatas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Validator\Mapping\ClassMetadata的用法示例。


在下文中一共展示了ClassMetadata::getMemberMetadatas方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: mergeConstraints

 /**
  * Merges the constraints of the given metadata into this object.
  *
  * @param ClassMetadata $source The source metadata
  */
 public function mergeConstraints(ClassMetadata $source)
 {
     foreach ($source->getConstraints() as $constraint) {
         $this->addConstraint(clone $constraint);
     }
     foreach ($source->getConstrainedProperties() as $property) {
         foreach ($source->getMemberMetadatas($property) as $member) {
             $member = clone $member;
             foreach ($member->getConstraints() as $constraint) {
                 $constraint->addImplicitGroupName($this->getDefaultGroup());
             }
             $this->addMemberMetadata($member);
             if (!$member->isPrivate($this->name)) {
                 $property = $member->getPropertyName();
                 if ($member instanceof PropertyMetadata && !isset($this->properties[$property])) {
                     $this->properties[$property] = $member;
                 } elseif ($member instanceof GetterMetadata && !isset($this->getters[$property])) {
                     $this->getters[$property] = $member;
                 }
             }
         }
     }
 }
開發者ID:gr-thao,項目名稱:jobeet,代碼行數:28,代碼來源:ClassMetadata.php

示例2: walkPropertyValue

 public function walkPropertyValue(ClassMetadata $metadata, $property, $value, $group, $propertyPath)
 {
     foreach ($metadata->getMemberMetadatas($property) as $member) {
         $this->walkMember($member, $value, $group, $propertyPath);
     }
 }
開發者ID:renegare,項目名稱:symfony,代碼行數:6,代碼來源:GraphWalker.php

示例3: walkPropertyValue

 /**
  * Validates a property of a class against a potential value.
  *
  * @param Mapping\ClassMetadata $metadata
  * @param                       $property
  * @param                       $value
  * @param                       $group
  * @param                       $propertyPath
  *
  * @deprecated Deprecated since version 2.2, to be removed in 2.3.
  */
 public function walkPropertyValue(ClassMetadata $metadata, $property, $value, $group, $propertyPath)
 {
     trigger_error('walkPropertyValue() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);
     foreach ($metadata->getMemberMetadatas($property) as $member) {
         $member->accept($this->visitor, $value, $group, $propertyPath);
     }
 }
開發者ID:brookinsconsulting,項目名稱:ezecosystem,代碼行數:18,代碼來源:GraphWalker.php

示例4: getMemberMetadatas

 /**
  * {@inheritDoc}
  */
 public function getMemberMetadatas($property)
 {
     return $this->validatorClassMetadata->getMemberMetadatas($property);
 }
開發者ID:fabricius,項目名稱:fabricius,代碼行數:7,代碼來源:ClassMetadata.php


注:本文中的Symfony\Component\Validator\Mapping\ClassMetadata::getMemberMetadatas方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。