芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/vendor/doctrine/dbal/src/Schema/SchemaDiff.php
$createdSchemas * @param array
$droppedSchemas * @param array
$createdSequences * @param array
$alteredSequences * @param array
$droppedSequences */ public function __construct( $newTables = [], $changedTables = [], $removedTables = [], ?Schema $fromSchema = null, $createdSchemas = [], $droppedSchemas = [], $createdSequences = [], $alteredSequences = [], $droppedSequences = [] ) { $this->newTables = $newTables; $this->changedTables = array_filter($changedTables, static function (TableDiff $diff): bool { return ! $diff->isEmpty(); }); $this->removedTables = $removedTables; $this->fromSchema = $fromSchema; $this->newNamespaces = $createdSchemas; $this->removedNamespaces = $droppedSchemas; $this->newSequences = $createdSequences; $this->changedSequences = $alteredSequences; $this->removedSequences = $droppedSequences; } /** @return array
*/ public function getCreatedSchemas(): array { return $this->newNamespaces; } /** @return array
*/ public function getDroppedSchemas(): array { return $this->removedNamespaces; } /** @return array
*/ public function getCreatedTables(): array { return $this->newTables; } /** @return array
*/ public function getAlteredTables(): array { return $this->changedTables; } /** @return array
*/ public function getDroppedTables(): array { return $this->removedTables; } /** @return array
*/ public function getCreatedSequences(): array { return $this->newSequences; } /** @return array
*/ public function getAlteredSequences(): array { return $this->changedSequences; } /** @return array
*/ public function getDroppedSequences(): array { return $this->removedSequences; } /** * Returns whether the diff is empty (contains no changes). */ public function isEmpty(): bool { return count($this->newNamespaces) === 0 && count($this->removedNamespaces) === 0 && count($this->newTables) === 0 && count($this->changedTables) === 0 && count($this->removedTables) === 0 && count($this->newSequences) === 0 && count($this->changedSequences) === 0 && count($this->removedSequences) === 0; } /** * The to save sql mode ensures that the following things don't happen: * * 1. Tables are deleted * 2. Sequences are deleted * 3. Foreign Keys which reference tables that would otherwise be deleted. * * This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all. * * @deprecated * * @return list
*/ public function toSaveSql(AbstractPlatform $platform) { Deprecation::trigger( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5766', '%s is deprecated.', __METHOD__, ); return $this->_toSql($platform, true); } /** * @deprecated Use {@link AbstractPlatform::getAlterSchemaSQL()} instead. * * @return list
*/ public function toSql(AbstractPlatform $platform) { Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5766', '%s is deprecated. Use AbstractPlatform::getAlterSchemaSQL() instead.', __METHOD__, ); return $this->_toSql($platform, false); } /** * @param bool $saveMode * * @return list
*/ protected function _toSql(AbstractPlatform $platform, $saveMode = false) { $sql = []; if ($platform->supportsSchemas()) { foreach ($this->getCreatedSchemas() as $schema) { $sql[] = $platform->getCreateSchemaSQL($schema); } } if ($platform->supportsForeignKeyConstraints() && $saveMode === false) { foreach ($this->orphanedForeignKeys as $orphanedForeignKey) { $sql[] = $platform->getDropForeignKeySQL($orphanedForeignKey, $orphanedForeignKey->getLocalTable()); } } if ($platform->supportsSequences() === true) { foreach ($this->getAlteredSequences() as $sequence) { $sql[] = $platform->getAlterSequenceSQL($sequence); } if ($saveMode === false) { foreach ($this->getDroppedSequences() as $sequence) { $sql[] = $platform->getDropSequenceSQL($sequence); } } foreach ($this->getCreatedSequences() as $sequence) { $sql[] = $platform->getCreateSequenceSQL($sequence); } } $sql = array_merge($sql, $platform->getCreateTablesSQL($this->getCreatedTables())); if ($saveMode === false) { $sql = array_merge($sql, $platform->getDropTablesSQL($this->getDroppedTables())); } foreach ($this->getAlteredTables() as $tableDiff) { $sql = array_merge($sql, $platform->getAlterTableSQL($tableDiff)); } return $sql; } }