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


PHP AbstractPlatform::getCreateTableSql方法代码示例

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


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

示例1: _toSql

 /**
  * @param AbstractPlatform $platform
  * @param bool $saveMode
  * @return array
  */
 protected function _toSql(AbstractPlatform $platform, $saveMode = false)
 {
     $sql = array();
     if ($platform->supportsForeignKeyConstraints() && $saveMode == false) {
         foreach ($this->orphanedForeignKeys as $orphanedForeignKey) {
             $sql[] = $platform->getDropForeignKeySql($orphanedForeignKey, $orphanedForeignKey->getLocalTableName());
         }
     }
     if ($platform->supportsSequences() == true) {
         foreach ($this->changedSequences as $sequence) {
             $sql[] = $platform->getDropSequenceSql($sequence);
             $sql[] = $platform->getCreateSequenceSql($sequence);
         }
         if ($saveMode === false) {
             foreach ($this->removedSequences as $sequence) {
                 $sql[] = $platform->getDropSequenceSql($sequence);
             }
         }
         foreach ($this->newSequences as $sequence) {
             $sql[] = $platform->getCreateSequenceSql($sequence);
         }
     }
     foreach ($this->newTables as $table) {
         $sql = array_merge($sql, $platform->getCreateTableSql($table, AbstractPlatform::CREATE_FOREIGNKEYS | AbstractPlatform::CREATE_INDEXES));
     }
     if ($saveMode === false) {
         foreach ($this->removedTables as $table) {
             $sql[] = $platform->getDropTableSql($table);
         }
     }
     foreach ($this->changedTables as $tableDiff) {
         $sql = array_merge($sql, $platform->getAlterTableSql($tableDiff));
     }
     return $sql;
 }
开发者ID:nvdnkpr,项目名称:symfony-demo,代码行数:40,代码来源:SchemaDiff.php

示例2: createTable

 /**
  * Create a new table.
  *
  * @param Table $table
  * @param int $createFlags
  */
 public function createTable(Table $table)
 {
     $createFlags = AbstractPlatform::CREATE_INDEXES | AbstractPlatform::CREATE_FOREIGNKEYS;
     $this->_execSql($this->_platform->getCreateTableSql($table, $createFlags));
 }
开发者ID:nvdnkpr,项目名称:symfony-demo,代码行数:11,代码来源:AbstractSchemaManager.php

示例3: acceptTable

 /**
  * Generate DDL Statements to create the accepted table with all its dependencies.
  *
  * @param Table $table
  */
 public function acceptTable(Table $table)
 {
     $this->_createTableQueries = array_merge($this->_createTableQueries, $this->_platform->getCreateTableSql($table));
 }
开发者ID:nvdnkpr,项目名称:symfony-demo,代码行数:9,代码来源:CreateSchemaSqlCollector.php


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