本文整理汇总了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;
}
示例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;
}
示例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;
}