From 9aa4e79aab0477b4212b01d65de53193d9559e39 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Mon, 10 Jul 2017 22:13:43 -0400 Subject: [PATCH] Moved getSequencePrefix() from ClassMetadata (ORM) to AbstractPlatform (DBAL) --- .../DBAL/Platforms/AbstractPlatform.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 016c09f86b5..e987dfd1726 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -3069,6 +3069,27 @@ public function usesSequenceEmulatedIdentityColumns() return false; } + /** + * Gets the sequence name prefix based on table information. + * + * @param string $tableName + * @param string|null $schemaName + * + * @return string + */ + public function getSequencePrefix($tableName, $schemaName = null) + { + if (! $schemaName) { + return $tableName; + } + + // Prepend the schema name to the table name if there is one + return (! $this->supportsSchemas() && $this->canEmulateSchemas()) + ? $schemaName . '__' . $tableName + : $schemaName . '.' . $tableName + ; + } + /** * Returns the name of the sequence for a particular identity column in a particular table. *