當前位置: 首頁>>代碼示例>>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: _getCreateTableSQL

 /**
  * {@inheritDoc}
  */
 protected function _getCreateTableSQL($tableName, array $columns, array $options = array())
 {
     $indexes = array();
     if (isset($options['indexes'])) {
         $indexes = $options['indexes'];
     }
     $options['indexes'] = array();
     $sqls = parent::_getCreateTableSQL($tableName, $columns, $options);
     foreach ($indexes as $definition) {
         $sqls[] = $this->getCreateIndexSQL($definition, $tableName);
     }
     return $sqls;
 }
開發者ID:doctrine,項目名稱:dbal,代碼行數:16,代碼來源:DB2Platform.php

示例2: _getCreateTableSQL

 /**
  *
  * @param string $table
  * @param array $columns
  * @param array $options
  * @return array
  */
 protected function _getCreateTableSQL($table, array $columns, array $options = array())
 {
     $indexes = isset($options['indexes']) ? $options['indexes'] : array();
     $options['indexes'] = array();
     $sql = parent::_getCreateTableSQL($table, $columns, $options);
     foreach ($columns as $name => $column) {
         if (isset($column['sequence'])) {
             $sql[] = $this->getCreateSequenceSQL($column['sequence'], 1);
         }
         if (isset($column['autoincrement']) && $column['autoincrement'] || isset($column['autoinc']) && $column['autoinc']) {
             $sql = array_merge($sql, $this->getCreateAutoincrementSql($name, $table));
         }
     }
     if (isset($indexes) && !empty($indexes)) {
         foreach ($indexes as $indexName => $index) {
             $sql[] = $this->getCreateIndexSQL($index, $table);
         }
     }
     return $sql;
 }
開發者ID:michaelnavarro,項目名稱:zc,代碼行數:27,代碼來源:OraclePlatform.php

示例3: _getCreateTableSQL

 /**
  * {@inheritDoc}
  */
 protected function _getCreateTableSQL($tableName, array $columns, array $options = array())
 {
     /*
      * Informix creates an automatic index in ascending order for the
      * unique, primary-key and referencial constraints. If you try to 
      * create an specific index in the same column or columns that fits
      * with the automatic index the database server returns an error. When
      * the index exists before the creation of the constraint, if is
      * possible, it's shared and no error is return, so it's important
      * that the indexes are created before the foreign key constraints.
      */
     $indexes = isset($options['indexes']) ? $options['indexes'] : array();
     $options['indexes'] = array();
     $foreignKeys = isset($options['foreignKeys']) ? $options['foreignKeys'] : array();
     $options['foreignKeys'] = array();
     $sqls = parent::_getCreateTableSQL($tableName, $columns, $options);
     foreach ($indexes as $definition) {
         $sqls[] = $this->getCreateIndexSQL($definition, $tableName);
     }
     foreach ($foreignKeys as $definition) {
         $sqls[] = $this->getCreateForeignKeySQL($definition, $tableName);
     }
     return $sqls;
 }
開發者ID:josemalonsom,項目名稱:ifx4dd,代碼行數:27,代碼來源:InformixPlatform.php


注:本文中的Doctrine\DBAL\Platforms\AbstractPlatform::_getCreateTableSQL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。