当前位置: 首页>>代码示例>>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;未经允许,请勿转载。