createTable = $subject; } /** * @param null|PlatformInterface $platform * @return string */ public function getSqlString(PlatformInterface $platform = null) { // localize variables foreach (get_object_vars($this->createTable) as $name => $value) { $this->{$name} = $value; } return parent::getSqlString($platform); } protected function processColumns(PlatformInterface $platform = null) { $sqls = array(); foreach ($this->columns as $i => $column) { $stmtContainer = $this->processExpression($column, $platform); $sql = $stmtContainer->getSql(); $columnOptions = $column->getOptions(); foreach ($columnOptions as $coName => $coValue) { switch (strtolower(str_replace(array('-', '_', ' '), '', $coName))) { case 'identity': case 'serial': case 'autoincrement': $sql .= ' AUTO_INCREMENT'; break; /* case 'primary': case 'primarykey': $sql .= ' PRIMARY KEY'; break; case 'unique': case 'uniquekey': $sql .= ' UNIQUE KEY'; break; */ case 'comment': $sql .= ' COMMENT \'' . $coValue . '\''; break; case 'columnformat': case 'format': $sql .= ' COLUMN_FORMAT ' . strtoupper($coValue); break; case 'storage': $sql .= ' STORAGE ' . strtoupper($coValue); break; } } $stmtContainer->setSql($sql); $sqls[$i] = $stmtContainer; } return array($sqls); } }