[2.0][DDC-265] Partial support to inheritanceType in AnnotationExporter. Still needs to add the discriminator column.
This commit is contained in:
parent
a56689be67
commit
de29fa97f0
2 changed files with 24 additions and 0 deletions
lib/Doctrine/ORM/Tools/Export/Driver
|
@ -297,6 +297,29 @@ class AnnotationExporter extends AbstractExporter
|
||||||
return '@Table(' . implode(', ', $table) . ')';
|
return '@Table(' . implode(', ', $table) . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function _getInheritanceAnnotation($metadata)
|
||||||
|
{
|
||||||
|
if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
|
||||||
|
switch ($metadata->inheritanceType) {
|
||||||
|
case ClassMetadataInfo::INHERITANCE_TYPE_JOINED:
|
||||||
|
$type = "JOINED";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE:
|
||||||
|
$type = "SINGLE_TABLE";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ClassMetadataInfo::INHERITANCE_TYPE_TABLE_PER_CLASS:
|
||||||
|
$type = "TABLE_PER_CLASS";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '@InheritanceType("'.$type.'")';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
private function _getJoinColumnAnnotation(array $joinColumn)
|
private function _getJoinColumnAnnotation(array $joinColumn)
|
||||||
{
|
{
|
||||||
$joinColumnAnnot = array();
|
$joinColumnAnnot = array();
|
||||||
|
|
|
@ -16,6 +16,7 @@ use <?php echo $this->_getClassToExtendNamespace() ?>;
|
||||||
* @Entity
|
* @Entity
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
* <?php echo $this->_getTableAnnotation($metadata)."\n" ?>
|
* <?php echo $this->_getTableAnnotation($metadata)."\n" ?>
|
||||||
|
* <?php echo $this->_getInheritanceAnnotation($metadata)."\n" ?>
|
||||||
*/
|
*/
|
||||||
class <?Php echo $this->_getClassName($metadata) ?><?php if ($this->_extendsClass()): ?> extends <?php echo $this->_getClassToExtendName() ?><?php endif; ?>
|
class <?Php echo $this->_getClassName($metadata) ?><?php if ($this->_extendsClass()): ?> extends <?php echo $this->_getClassToExtendName() ?><?php endif; ?>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue