当前位置: 首页>>代码示例>>PHP>>正文


PHP Table::getColumn方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\Schema\Table::getColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getColumn方法的具体用法?PHP Table::getColumn怎么用?PHP Table::getColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\Schema\Table的用法示例。


在下文中一共展示了Table::getColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: table_should_contain_binary_uuid_column

 /**
  * @test
  */
 public function table_should_contain_binary_uuid_column()
 {
     $uuidColumn = $this->table->getColumn('uuid');
     $this->assertEquals(16, $uuidColumn->getLength());
     $this->assertEquals(Type::getType(Type::BINARY), $uuidColumn->getType());
     $this->assertTrue($uuidColumn->getFixed());
 }
开发者ID:2dotstwice,项目名称:broadway,代码行数:10,代码来源:BinaryDBALEventStoreTest.php

示例2: enableDataAudit

 /**
  * @param Table $taskTable
  */
 protected function enableDataAudit(Table $taskTable)
 {
     $taskTable->addOption(OroOptions::KEY, ['dataaudit' => ['auditable' => true]]);
     $taskTable->getColumn('subject')->setOptions([OroOptions::KEY => ['dataaudit' => ['auditable' => true]]]);
     $taskTable->getColumn('description')->setOptions([OroOptions::KEY => ['dataaudit' => ['auditable' => true]]]);
     $taskTable->getColumn('due_date')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'dueDate', 'dataaudit' => ['auditable' => true]]]);
     $taskTable->getColumn('task_priority_name')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'taskPriority', 'dataaudit' => ['auditable' => true]]]);
     $taskTable->getColumn('owner_id')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'owner', 'dataaudit' => ['auditable' => true]]]);
 }
开发者ID:antrampa,项目名称:crm,代码行数:12,代码来源:OroCRMTaskBundle.php

示例3: get

 /**
  * Get a data key by name.
  *
  * @param  string $key
  * @return mixed
  */
 public function get($key)
 {
     if (is_null($this->data)) {
         $this->data = $this->table->getColumn($this->name)->toArray();
     }
     return $this->data[$key];
 }
开发者ID:erikgall,项目名称:eloquent-phpunit,代码行数:13,代码来源:Column.php

示例4: addIndex

 /**
  * Add or update an index to the table
  *
  * @param       $columns
  * @param       $name
  * @param array $options
  *
  * @throws SchemaException
  */
 public function addIndex($columns, $name, $options = array())
 {
     if (!is_array($columns)) {
         $columns = array($columns);
     }
     foreach ($columns as $column) {
         if (!in_array($column, $this->allowedColumns)) {
             $columnSchema = $this->table->getColumn($column);
             $type = $columnSchema->getType();
             if ($type instanceof StringType) {
                 $this->allowedColumns[] = $columnSchema->getName();
             }
         }
     }
     // Indexes are only allowed on columns that are string
     $columns = array_intersect($columns, $this->allowedColumns);
     if (!empty($columns)) {
         $index = new Index($this->prefix . $name, $columns, false, false, $options);
         if ($this->table->hasIndex($this->prefix . $name)) {
             $this->changedIndexes[] = $index;
         } else {
             $this->addedIndexes[] = $index;
         }
     }
 }
开发者ID:Yame-,项目名称:mautic,代码行数:34,代码来源:IndexSchemaHelper.php

示例5: getSql

 public function getSql(Table $table, array $columns, array $options = array())
 {
     $spatialGeometryColumns = array();
     if (!$this->isPostGis2) {
         $normalColumns = array();
         foreach ($columns as $name => $columnData) {
             if ('geometry' !== $columnData['type']->getName()) {
                 $normalColumns[$name] = $columnData;
             } else {
                 $spatialGeometryColumns[] = $table->getColumn($name);
             }
         }
         $columns = $normalColumns;
     }
     $spatialIndexes = array();
     if (isset($options['indexes']) && !empty($options['indexes'])) {
         $indexes = array();
         foreach ($options['indexes'] as $index) {
             if (!$index->hasFlag('SPATIAL')) {
                 $indexes[] = $index;
             } else {
                 $spatialIndexes[] = $index;
             }
         }
         $options['indexes'] = $indexes;
     }
     $sql = $this->getCreateTableSQL($table, $columns, $options);
     foreach ($spatialGeometryColumns as $column) {
         $sql = array_merge($sql, $this->spatialColumnSqlGenerator->getSql($column, $table));
     }
     foreach ($spatialIndexes as $index) {
         $sql[] = $this->spatialIndexSqlGenerator->getSql($index, $table);
     }
     return $sql;
 }
开发者ID:novikovsergey,项目名称:doctrine-postgis,代码行数:35,代码来源:CreateTableSqlGenerator.php

示例6: renameColumn

 /**
  * Renames a column
  *
  * @param Schema   $schema
  * @param QueryBag $queries
  * @param Table    $table
  * @param string   $oldColumnName
  * @param string   $newColumnName
  */
 public function renameColumn(Schema $schema, QueryBag $queries, Table $table, $oldColumnName, $newColumnName)
 {
     $column = new Column(['column' => $table->getColumn($oldColumnName)]);
     $column->changeName($newColumnName);
     $diff = new TableDiff($table->getName());
     $diff->renamedColumns = [$oldColumnName => $column];
     $renameQuery = new SqlMigrationQuery($this->platform->getAlterTableSQL($diff));
     $queries->addQuery($renameQuery);
 }
开发者ID:ramunasd,项目名称:MigrationBundle,代码行数:18,代码来源:RenameExtension.php

示例7: enableDataAudit

 /**
  * @param Table $table
  */
 protected function enableDataAudit(Table $table)
 {
     $table->addOption(OroOptions::KEY, ['dataaudit' => ['auditable' => true]]);
     $table->getColumn('title')->setOptions([OroOptions::KEY => ['dataaudit' => ['auditable' => true]]]);
     $table->getColumn('description')->setOptions([OroOptions::KEY => ['dataaudit' => ['auditable' => true]]]);
     $table->getColumn('start_at')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'start', 'dataaudit' => ['auditable' => true]]]);
     $table->getColumn('end_at')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'end', 'dataaudit' => ['auditable' => true]]]);
     $table->getColumn('calendar_id')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'calendar', 'dataaudit' => ['auditable' => true]]]);
     $table->getColumn('all_day')->setOptions([OroOptions::KEY => [ExtendOptionsManager::FIELD_NAME_OPTION => 'allDay', 'dataaudit' => ['auditable' => true]]]);
 }
开发者ID:Maksold,项目名称:platform,代码行数:13,代码来源:OroCalendarBundle.php

示例8: saveTable

 /**
  * @param \Doctrine\DBAL\Schema\Table $table
  * @param \SimpleXMLElement $xml
  */
 private static function saveTable($table, $xml)
 {
     $xml->addChild('name', $table->getName());
     $declaration = $xml->addChild('declaration');
     foreach ($table->getColumns() as $column) {
         self::saveColumn($column, $declaration->addChild('field'));
     }
     foreach ($table->getIndexes() as $index) {
         if ($index->getName() == 'PRIMARY') {
             $autoincrement = false;
             foreach ($index->getColumns() as $column) {
                 if ($table->getColumn($column)->getAutoincrement()) {
                     $autoincrement = true;
                 }
             }
             if ($autoincrement) {
                 continue;
             }
         }
         self::saveIndex($index, $declaration->addChild('index'));
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:26,代码来源:MDB2SchemaWriter.php

示例9: diffTable

 /**
  * Returns the difference between the tables $table1 and $table2.
  *
  * If there are no differences this method returns the boolean false.
  *
  * @param \Doctrine\DBAL\Schema\Table $table1
  * @param \Doctrine\DBAL\Schema\Table $table2
  *
  * @return boolean|\Doctrine\DBAL\Schema\TableDiff
  */
 public function diffTable(Table $table1, Table $table2)
 {
     $changes = 0;
     $tableDifferences = new TableDiff($table1->getName());
     $tableDifferences->fromTable = $table1;
     $table1Columns = $table1->getColumns();
     $table2Columns = $table2->getColumns();
     /* See if all the fields in table 1 exist in table 2 */
     foreach ($table2Columns as $columnName => $column) {
         if (!$table1->hasColumn($columnName)) {
             $tableDifferences->addedColumns[$columnName] = $column;
             $changes++;
         }
     }
     /* See if there are any removed fields in table 2 */
     foreach ($table1Columns as $columnName => $column) {
         // See if column is removed in table 2.
         if (!$table2->hasColumn($columnName)) {
             $tableDifferences->removedColumns[$columnName] = $column;
             $changes++;
             continue;
         }
         // See if column has changed properties in table 2.
         $changedProperties = $this->diffColumn($column, $table2->getColumn($columnName));
         if (!empty($changedProperties)) {
             $columnDiff = new ColumnDiff($column->getName(), $table2->getColumn($columnName), $changedProperties);
             $columnDiff->fromColumn = $column;
             $tableDifferences->changedColumns[$column->getName()] = $columnDiff;
             $changes++;
         }
     }
     $this->detectColumnRenamings($tableDifferences);
     $table1Indexes = $table1->getIndexes();
     $table2Indexes = $table2->getIndexes();
     /* See if all the indexes in table 1 exist in table 2 */
     foreach ($table2Indexes as $indexName => $index) {
         if ($index->isPrimary() && $table1->hasPrimaryKey() || $table1->hasIndex($indexName)) {
             continue;
         }
         $tableDifferences->addedIndexes[$indexName] = $index;
         $changes++;
     }
     /* See if there are any removed indexes in table 2 */
     foreach ($table1Indexes as $indexName => $index) {
         // See if index is removed in table 2.
         if ($index->isPrimary() && !$table2->hasPrimaryKey() || !$index->isPrimary() && !$table2->hasIndex($indexName)) {
             $tableDifferences->removedIndexes[$indexName] = $index;
             $changes++;
             continue;
         }
         // See if index has changed in table 2.
         $table2Index = $index->isPrimary() ? $table2->getPrimaryKey() : $table2->getIndex($indexName);
         if ($this->diffIndex($index, $table2Index)) {
             $tableDifferences->changedIndexes[$indexName] = $table2Index;
             $changes++;
         }
     }
     $this->detectIndexRenamings($tableDifferences);
     $fromFkeys = $table1->getForeignKeys();
     $toFkeys = $table2->getForeignKeys();
     foreach ($fromFkeys as $key1 => $constraint1) {
         foreach ($toFkeys as $key2 => $constraint2) {
             if ($this->diffForeignKey($constraint1, $constraint2) === false) {
                 unset($fromFkeys[$key1]);
                 unset($toFkeys[$key2]);
             } else {
                 if (strtolower($constraint1->getName()) == strtolower($constraint2->getName())) {
                     $tableDifferences->changedForeignKeys[] = $constraint2;
                     $changes++;
                     unset($fromFkeys[$key1]);
                     unset($toFkeys[$key2]);
                 }
             }
         }
     }
     foreach ($fromFkeys as $constraint1) {
         $tableDifferences->removedForeignKeys[] = $constraint1;
         $changes++;
     }
     foreach ($toFkeys as $constraint2) {
         $tableDifferences->addedForeignKeys[] = $constraint2;
         $changes++;
     }
     return $changes ? $tableDifferences : false;
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:95,代码来源:Comparator.php

示例10: getCreateForeignKeySQL

 /**
  * @param ForeignKeyConstraint $foreignKey
  * @param Table|string         $table
  *
  * @return string
  */
 public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
 {
     $columns = $foreignKey->getColumns();
     $column = reset($columns);
     $column = $table->getColumn($column);
     $sql = array();
     if ($column->hasCustomSchemaOption('definedIn') and $column->getCustomSchemaOption('definedIn') === 'link') {
         $sql = $this->_getCreateColumnSQL($foreignKey->getLocalTableName(), $column->getName(), $column->toArray());
     }
     return $sql;
 }
开发者ID:mihai-stancu,项目名称:orientdb-orm,代码行数:17,代码来源:OrientDBPlatform.php

示例11: diffTable

 /**
  * Returns the difference between the tables $table1 and $table2.
  *
  * If there are no differences this method returns the boolean false.
  *
  * @param \Doctrine\DBAL\Schema\Table $table1
  * @param \Doctrine\DBAL\Schema\Table $table2
  *
  * @return boolean|\Doctrine\DBAL\Schema\TableDiff
  */
 public function diffTable(Table $table1, Table $table2)
 {
     $changes = 0;
     $tableDifferences = new TableDiff($table1->getName());
     $tableDifferences->fromTable = $table1;
     $table1Columns = $table1->getColumns();
     $table2Columns = $table2->getColumns();
     /* See if all the fields in table 1 exist in table 2 */
     foreach ($table2Columns as $columnName => $column) {
         if (!$table1->hasColumn($columnName)) {
             $tableDifferences->addedColumns[$columnName] = $column;
             $changes++;
         }
     }
     /* See if there are any removed fields in table 2 */
     foreach ($table1Columns as $columnName => $column) {
         // See if column is removed in table 2.
         if (!$table2->hasColumn($columnName)) {
             $tableDifferences->removedColumns[$columnName] = $column;
             $changes++;
             continue;
         }
         // See if column has changed properties in table 2.
         $changedProperties = $this->diffColumn($column, $table2->getColumn($columnName));
         if (!empty($changedProperties)) {
             $columnDiff = new ColumnDiff($column->getName(), $table2->getColumn($columnName), $changedProperties);
             $columnDiff->fromColumn = $column;
             $tableDifferences->changedColumns[$column->getName()] = $columnDiff;
             $changes++;
         }
     }
     // #BUG-2317 Avoid column renaming when both enable and disable different modules
     // $this->detectColumnRenamings($tableDifferences);
     $table1Indexes = $table1->getIndexes();
     $table2Indexes = $table2->getIndexes();
     foreach ($table2Indexes as $index2Name => $index2Definition) {
         foreach ($table1Indexes as $index1Name => $index1Definition) {
             if ($this->diffIndex($index1Definition, $index2Definition) === false) {
                 /*if ( ! $index1Definition->isPrimary() && $index1Name != $index2Name) {
                       $tableDifferences->renamedIndexes[$index1Name] = $index2Definition;
                       $changes++;
                   }*/
                 unset($table1Indexes[$index1Name]);
                 unset($table2Indexes[$index2Name]);
             } else {
                 if ($index1Name == $index2Name) {
                     $tableDifferences->changedIndexes[$index2Name] = $table2Indexes[$index2Name];
                     unset($table1Indexes[$index1Name]);
                     unset($table2Indexes[$index2Name]);
                     $changes++;
                 }
             }
         }
     }
     foreach ($table1Indexes as $index1Name => $index1Definition) {
         $tableDifferences->removedIndexes[$index1Name] = $index1Definition;
         $changes++;
     }
     foreach ($table2Indexes as $index2Name => $index2Definition) {
         $tableDifferences->addedIndexes[$index2Name] = $index2Definition;
         $changes++;
     }
     $fromFkeys = $table1->getForeignKeys();
     $toFkeys = $table2->getForeignKeys();
     foreach ($fromFkeys as $key1 => $constraint1) {
         foreach ($toFkeys as $key2 => $constraint2) {
             if ($this->diffForeignKey($constraint1, $constraint2) === false) {
                 unset($fromFkeys[$key1]);
                 unset($toFkeys[$key2]);
             } else {
                 if (strtolower($constraint1->getName()) == strtolower($constraint2->getName())) {
                     $tableDifferences->changedForeignKeys[] = $constraint2;
                     $changes++;
                     unset($fromFkeys[$key1]);
                     unset($toFkeys[$key2]);
                 }
             }
         }
     }
     foreach ($fromFkeys as $constraint1) {
         $tableDifferences->removedForeignKeys[] = $constraint1;
         $changes++;
     }
     foreach ($toFkeys as $constraint2) {
         $tableDifferences->addedForeignKeys[] = $constraint2;
         $changes++;
     }
     return $changes ? $tableDifferences : false;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:99,代码来源:Comparator.php

示例12: checkColumnsExist

 /**
  * @param Table    $table
  * @param string[] $columnNames
  * @throws \InvalidArgumentException if $columnNames array is empty
  * @throws SchemaException if any column is not exist
  */
 protected function checkColumnsExist($table, array $columnNames)
 {
     if (empty($columnNames)) {
         throw new \InvalidArgumentException('At least one column must be specified.');
     }
     foreach ($columnNames as $columnName) {
         $table->getColumn($columnName);
     }
 }
开发者ID:hugeval,项目名称:platform,代码行数:15,代码来源:ExtendExtension.php

示例13: checkIndex

 /**
  * @param Table     $table
  * @param Index     $index
  * @param Migration $migration
  *
  * @throws InvalidNameException
  */
 protected function checkIndex(Table $table, Index $index, Migration $migration)
 {
     $columns = $index->getColumns();
     foreach ($columns as $columnName) {
         if ($table->getColumn($columnName)->getLength() > MySqlPlatform::LENGTH_LIMIT_TINYTEXT) {
             throw new InvalidNameException(sprintf('Could not create index for column with length more than %s. ' . 'Please correct "%s" column length "%s" in table in "%s" migration', MySqlPlatform::LENGTH_LIMIT_TINYTEXT, $columnName, $table->getName(), get_class($migration)));
         }
     }
 }
开发者ID:ramunasd,项目名称:platform,代码行数:16,代码来源:MigrationExecutor.php

示例14: getCreateTableSQL

 /**
  * Gets the SQL statement(s) to create a table with the specified name, columns and constraints
  * on this platform.
  *
  * @param string $table The name of the table.
  * @param integer $createFlags
  *
  * @return array The sequence of SQL statements.
  */
 public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES)
 {
     if (!is_int($createFlags)) {
         throw new \InvalidArgumentException("Second argument of AbstractPlatform::getCreateTableSQL() has to be integer.");
     }
     if (count($table->getColumns()) === 0) {
         throw DBALException::noColumnsSpecifiedForTable($table->getName());
     }
     $tableName = $table->getQuotedName($this);
     $options = $table->getOptions();
     $options['uniqueConstraints'] = array();
     $options['indexes'] = array();
     $options['primary'] = array();
     if (($createFlags & self::CREATE_INDEXES) > 0) {
         foreach ($table->getIndexes() as $index) {
             /* @var $index Index */
             if ($index->isPrimary()) {
                 $platform = $this;
                 $options['primary'] = array_map(function ($columnName) use($table, $platform) {
                     return $table->getColumn($columnName)->getQuotedName($platform);
                 }, $index->getColumns());
                 $options['primary_index'] = $index;
             } else {
                 $options['indexes'][$index->getName()] = $index;
             }
         }
     }
     $columnSql = array();
     $columns = array();
     foreach ($table->getColumns() as $column) {
         /* @var \Doctrine\DBAL\Schema\Column $column */
         if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn)) {
             $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this);
             $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs);
             $columnSql = array_merge($columnSql, $eventArgs->getSql());
             if ($eventArgs->isDefaultPrevented()) {
                 continue;
             }
         }
         $columnData = array();
         $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;
         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;
         }
         $columns[$columnData['name']] = $columnData;
     }
     if (($createFlags & self::CREATE_FOREIGNKEYS) > 0) {
         $options['foreignKeys'] = array();
         foreach ($table->getForeignKeys() as $fkConstraint) {
             $options['foreignKeys'][] = $fkConstraint;
         }
     }
     if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTable)) {
         $eventArgs = new SchemaCreateTableEventArgs($table, $columns, $options, $this);
         $this->_eventManager->dispatchEvent(Events::onSchemaCreateTable, $eventArgs);
         if ($eventArgs->isDefaultPrevented()) {
             return array_merge($eventArgs->getSql(), $columnSql);
         }
     }
     $sql = $this->_getCreateTableSQL($tableName, $columns, $options);
     if ($this->supportsCommentOnStatement()) {
         foreach ($table->getColumns() as $column) {
             if ($this->getColumnComment($column)) {
                 $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getName(), $this->getColumnComment($column));
             }
         }
     }
     return array_merge($sql, $columnSql);
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:95,代码来源:AbstractPlatform.php

示例15: getCreateTableSQL

 /**
  * {@inheritDoc}
  * Gets the SQL statement(s) to create a table with the specified name, columns and constraints
  * on this platform.
  *
  * @param Table $table The name of the table.
  * @param integer $createFlags
  *
  * @return array The sequence of SQL statements.
  */
 public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES)
 {
     if (!is_int($createFlags)) {
         $msg = "Second argument of CratePlatform::getCreateTableSQL() has to be integer.";
         throw new \InvalidArgumentException($msg);
     }
     if (count($table->getColumns()) === 0) {
         throw DBALException::noColumnsSpecifiedForTable($table->getName());
     }
     $tableName = $table->getQuotedName($this);
     $options = $table->getOptions();
     $options['uniqueConstraints'] = array();
     $options['indexes'] = array();
     $options['primary'] = array();
     if (($createFlags & self::CREATE_INDEXES) > 0) {
         foreach ($table->getIndexes() as $index) {
             /* @var $index Index */
             if ($index->isPrimary()) {
                 $platform = $this;
                 $options['primary'] = array_map(function ($columnName) use($table, $platform) {
                     return $table->getColumn($columnName)->getQuotedName($platform);
                 }, $index->getColumns());
                 $options['primary_index'] = $index;
             } else {
                 $options['indexes'][$index->getName()] = $index;
             }
         }
     }
     $columnSql = array();
     $columns = array();
     foreach ($table->getColumns() as $column) {
         if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn)) {
             $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this);
             $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs);
             $columnSql = array_merge($columnSql, $eventArgs->getSql());
             if ($eventArgs->isDefaultPrevented()) {
                 continue;
             }
         }
         $columns[$column->getQuotedName($this)] = $this->prepareColumnData($column, $options['primary']);
     }
     if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTable)) {
         $eventArgs = new SchemaCreateTableEventArgs($table, $columns, $options, $this);
         $this->_eventManager->dispatchEvent(Events::onSchemaCreateTable, $eventArgs);
         if ($eventArgs->isDefaultPrevented()) {
             return array_merge($eventArgs->getSql(), $columnSql);
         }
     }
     $sql = $this->_getCreateTableSQL($tableName, $columns, $options);
     if ($this->supportsCommentOnStatement()) {
         foreach ($table->getColumns() as $column) {
             if ($this->getColumnComment($column)) {
                 $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getName(), $this->getColumnComment($column));
             }
         }
     }
     return array_merge($sql, $columnSql);
 }
开发者ID:crate,项目名称:crate-dbal,代码行数:68,代码来源:CratePlatform.php


注:本文中的Doctrine\DBAL\Schema\Table::getColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。