1
0
mirror of synced 2024-12-14 23:26:04 +03:00

check if parent class is a mapped superclass

This commit is contained in:
Fabio B. Silva 2011-09-08 13:41:16 -03:00
parent 7f0275155d
commit 19d0887bb0
3 changed files with 6 additions and 2 deletions

View File

@ -274,8 +274,10 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
$class->setDiscriminatorMap($parent->discriminatorMap); $class->setDiscriminatorMap($parent->discriminatorMap);
$class->setLifecycleCallbacks($parent->lifecycleCallbacks); $class->setLifecycleCallbacks($parent->lifecycleCallbacks);
$class->setChangeTrackingPolicy($parent->changeTrackingPolicy); $class->setChangeTrackingPolicy($parent->changeTrackingPolicy);
if ($parent->isMappedSuperclass) {
$class->setCustomRepositoryClass($parent->customRepositoryClassName); $class->setCustomRepositoryClass($parent->customRepositoryClassName);
} }
}
// Invoke driver // Invoke driver
try { try {

View File

@ -49,6 +49,7 @@ class DDC869Payment
'fieldName' => 'value', 'fieldName' => 'value',
'type' => 'float', 'type' => 'float',
)); ));
$metadata->isMappedSuperclass = true;
$metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); $metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository");
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_AUTO); $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_AUTO);
} }

View File

@ -12,5 +12,6 @@ $metadata->mapField(array(
'fieldName' => 'value', 'fieldName' => 'value',
'type' => 'float', 'type' => 'float',
)); ));
$metadata->isMappedSuperclass = true;
$metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository"); $metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository");
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);