Commit de29fa97 authored by guilhermeblanco's avatar guilhermeblanco

[2.0][DDC-265] Partial support to inheritanceType in AnnotationExporter. Still...

[2.0][DDC-265] Partial support to inheritanceType in AnnotationExporter. Still needs to add the discriminator column.
parent a56689be
......@@ -297,6 +297,29 @@ class AnnotationExporter extends AbstractExporter
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)
{
$joinColumnAnnot = array();
......
......@@ -16,6 +16,7 @@ use <?php echo $this->_getClassToExtendNamespace() ?>;
* @Entity
<?php endif; ?>
* <?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; ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment