From 0ff4d9bf4553f9155b88d5a754fc79ef01f9272d 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 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 072443e8757..640c2eb4d9a 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -3092,6 +3092,26 @@ 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. *