Skip to content

Commit

Permalink
Obtain all informations about a column via Column::toArray()
Browse files Browse the repository at this point in the history
  • Loading branch information
hason committed Jan 8, 2013
1 parent e65517e commit 8791900
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -1193,27 +1193,15 @@ public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDE
}
}

$columnData = array();
$columnData = $column->toArray();
$columnData['name'] = $column->getQuotedName($this);
$columnData['type'] = $column->getType();
$columnData['length'] = $column->getLength();
$columnData['notnull'] = $column->getNotNull();
$columnData['fixed'] = $column->getFixed();
$columnData['unique'] = false; // TODO: what do we do about this?
$columnData['version'] = $column->hasPlatformOption("version") ? $column->getPlatformOption('version') : false;
$columnData['comment'] = $this->getColumnComment($column);

if (strtolower($columnData['type']) == "string" && $columnData['length'] === null) {
$columnData['length'] = 255;
}

$columnData['unsigned'] = $column->getUnsigned();
$columnData['precision'] = $column->getPrecision();
$columnData['scale'] = $column->getScale();
$columnData['default'] = $column->getDefault();
$columnData['columnDefinition'] = $column->getColumnDefinition();
$columnData['autoincrement'] = $column->getAutoincrement();
$columnData['comment'] = $this->getColumnComment($column);

if (in_array($column->getName(), $options['primary'])) {
$columnData['primary'] = true;
}
Expand Down

0 comments on commit 8791900

Please sign in to comment.