本文整理汇总了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);
}
示例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;
}
}
}
}
}
示例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;
}
}
}
}
}
}
示例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;
}
}
}
}
}