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


PHP ClassMetadataInfo::getName方法代码示例

本文整理汇总了PHP中Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassMetadataInfo::getName方法的具体用法?PHP ClassMetadataInfo::getName怎么用?PHP ClassMetadataInfo::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo的用法示例。


在下文中一共展示了ClassMetadataInfo::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function it_configures_the_mappings_of_a_model_that_overrides_an_original_model($configuration, ClassMetadataInfo $metadataInfo, MappingDriver $mappingDriver)
 {
     $originalQux1 = __NAMESPACE__ . '\\OriginalQux1';
     $originalQux2 = __NAMESPACE__ . '\\OriginalQux2';
     $overrideQux1 = __NAMESPACE__ . '\\OverrideQux1';
     $overrideQux2 = __NAMESPACE__ . '\\OverrideQux2';
     $mappingDriver->getAllClassNames()->willReturn([$originalQux1]);
     $configuration->getMetadataDriverImpl()->willReturn($mappingDriver);
     $metadataInfo->getName()->willReturn($overrideQux1);
     $mappingDriver->loadMetadataForClass($originalQux1, Argument::any())->shouldBeCalled();
     $overrides = [['original' => $originalQux1, 'override' => $overrideQux1], ['original' => $originalQux2, 'override' => $overrideQux2]];
     $this->configure($metadataInfo, $overrides, $configuration);
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:13,代码来源:MappingsOverrideConfiguratorSpec.php

示例2: setAssociationMappings

 /**
  * Set the association mappings of a metadata.
  *
  * @param ClassMetadataInfo $metadata
  * @param Configuration     $configuration
  */
 protected function setAssociationMappings(ClassMetadataInfo $metadata, Configuration $configuration)
 {
     $supportedClasses = $configuration->getMetadataDriverImpl()->getAllClassNames();
     foreach (class_parents($metadata->getName()) as $parent) {
         if (in_array($parent, $supportedClasses)) {
             $parentMetadata = new MongoClassMetadata($parent);
             $configuration->getMetadataDriverImpl()->loadMetadataForClass($parent, $parentMetadata);
             foreach ($parentMetadata->associationMappings as $key => $value) {
                 if ($this->hasRelation($value['association'])) {
                     $metadata->associationMappings[$key] = $value;
                 }
             }
         }
     }
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:21,代码来源:MappingsOverrideConfigurator.php

示例3: setAssociationMappings

 /**
  * @param ClassMetadataInfo $metadata
  * @param $configuration
  */
 private function setAssociationMappings(ClassMetadataInfo $metadata, $configuration)
 {
     foreach (class_parents($metadata->getName()) as $parent) {
         $parentMetadata = new ClassMetadata($parent);
         if (in_array($parent, $configuration->getMetadataDriverImpl()->getAllClassNames())) {
             $configuration->getMetadataDriverImpl()->loadMetadataForClass($parent, $parentMetadata);
             if ($parentMetadata->isMappedSuperclass) {
                 foreach ($parentMetadata->associationMappings as $key => $value) {
                     if ($this->hasRelation($value['association'])) {
                         $metadata->associationMappings[$key] = $value;
                     }
                 }
             }
         }
     }
 }
开发者ID:bendavies,项目名称:Sylius,代码行数:20,代码来源:LoadODMMetadataSubscriber.php

示例4: setAssociationMappings

 /**
  * @param ClassMetadataInfo $metadata
  * @param $configuration
  */
 private function setAssociationMappings(ClassMetadataInfo $metadata, $configuration)
 {
     foreach (class_parents($metadata->getName()) as $parent) {
         if (false === in_array($parent, $configuration->getMetadataDriverImpl()->getAllClassNames())) {
             continue;
         }
         $parentMetadata = new ClassMetadata($parent, $configuration->getNamingStrategy());
         // Wakeup Reflection
         $parentMetadata->wakeupReflection($this->getReflectionService());
         // Load Metadata
         $configuration->getMetadataDriverImpl()->loadMetadataForClass($parent, $parentMetadata);
         if (false === $this->isResource($parentMetadata)) {
             continue;
         }
         if ($parentMetadata->isMappedSuperclass) {
             foreach ($parentMetadata->associationMappings as $key => $value) {
                 if ($this->hasRelation($value['association'])) {
                     $metadata->associationMappings[$key] = $value;
                 }
             }
         }
     }
 }
开发者ID:loic425,项目名称:Sylius,代码行数:27,代码来源:ODMMappedSuperClassSubscriber.php


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