本文整理匯總了PHP中Doctrine\DBAL\Platforms\AbstractPlatform::getCreateSequenceSQL方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractPlatform::getCreateSequenceSQL方法的具體用法?PHP AbstractPlatform::getCreateSequenceSQL怎麽用?PHP AbstractPlatform::getCreateSequenceSQL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\DBAL\Platforms\AbstractPlatform
的用法示例。
在下文中一共展示了AbstractPlatform::getCreateSequenceSQL方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _toSql
/**
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @param boolean $saveMode
*
* @return array
*/
protected function _toSql(AbstractPlatform $platform, $saveMode = false)
{
$sql = array();
if ($platform->supportsSchemas()) {
foreach ($this->newNamespaces as $newNamespace) {
$sql[] = $platform->getCreateSchemaSQL($newNamespace);
}
}
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->getAlterSequenceSQL($sequence);
}
if ($saveMode === false) {
foreach ($this->removedSequences as $sequence) {
$sql[] = $platform->getDropSequenceSQL($sequence);
}
}
foreach ($this->newSequences as $sequence) {
$sql[] = $platform->getCreateSequenceSQL($sequence);
}
}
$foreignKeySql = array();
foreach ($this->newTables as $table) {
$sql = array_merge($sql, $platform->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES));
if ($platform->supportsForeignKeyConstraints()) {
foreach ($table->getForeignKeys() as $foreignKey) {
$foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table);
}
}
}
$sql = array_merge($sql, $foreignKeySql);
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;
}
示例2: createSequence
/**
* Create a new sequence
*
* @param Sequence $sequence
* @throws Doctrine\DBAL\ConnectionException if something fails at database level
*/
public function createSequence($sequence)
{
$this->_execSql($this->_platform->getCreateSequenceSQL($sequence));
}
示例3: acceptSequence
/**
* {@inheritdoc}
*/
public function acceptSequence(Sequence $sequence)
{
$this->createSequenceQueries = array_merge($this->createSequenceQueries, (array) $this->platform->getCreateSequenceSQL($sequence));
}
示例4: acceptSequence
/**
* @param Sequence $sequence
*/
public function acceptSequence(Sequence $sequence)
{
$namespace = $this->getNamespace($sequence);
$this->_createSequenceQueries[$namespace] = array_merge($this->_createSequenceQueries[$namespace], (array) $this->_platform->getCreateSequenceSQL($sequence));
}
示例5: acceptSequence
/**
* {@inheritdoc}
*/
public function acceptSequence(Sequence $sequence)
{
$this->createSequenceQueries[] = $this->platform->getCreateSequenceSQL($sequence);
}