Rename method and refactor code a bit
This commit is contained in:
parent
abb129028a
commit
c965d231b1
@ -145,7 +145,7 @@ class SchemaTool
|
|||||||
$this->_gatherRelationsSql($class, $table, $schema);
|
$this->_gatherRelationsSql($class, $table, $schema);
|
||||||
|
|
||||||
// Add the discriminator column
|
// Add the discriminator column
|
||||||
$discrColumnDef = $this->_getDiscriminatorColumnDefinition($class, $table);
|
$this->addDiscriminatorColumnDefinition($class, $table);
|
||||||
|
|
||||||
// Aggregate all the information from all classes in the hierarchy
|
// Aggregate all the information from all classes in the hierarchy
|
||||||
foreach ($class->parentClasses as $parentClassName) {
|
foreach ($class->parentClasses as $parentClassName) {
|
||||||
@ -177,7 +177,7 @@ class SchemaTool
|
|||||||
|
|
||||||
// Add the discriminator column only to the root table
|
// Add the discriminator column only to the root table
|
||||||
if ($class->name == $class->rootEntityName) {
|
if ($class->name == $class->rootEntityName) {
|
||||||
$discrColumnDef = $this->_getDiscriminatorColumnDefinition($class, $table);
|
$this->addDiscriminatorColumnDefinition($class, $table);
|
||||||
} else {
|
} else {
|
||||||
// Add an ID FK column to child tables
|
// Add an ID FK column to child tables
|
||||||
/* @var Doctrine\ORM\Mapping\ClassMetadata $class */
|
/* @var Doctrine\ORM\Mapping\ClassMetadata $class */
|
||||||
@ -267,7 +267,7 @@ class SchemaTool
|
|||||||
* @return array The portable column definition of the discriminator column as required by
|
* @return array The portable column definition of the discriminator column as required by
|
||||||
* the DBAL.
|
* the DBAL.
|
||||||
*/
|
*/
|
||||||
private function _getDiscriminatorColumnDefinition($class, $table)
|
private function addDiscriminatorColumnDefinition($class, $table)
|
||||||
{
|
{
|
||||||
$discrColumn = $class->discriminatorColumn;
|
$discrColumn = $class->discriminatorColumn;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user