Skip to content

Commit

Permalink
Moved getSequencePrefix() from ClassMetadata (ORM) to AbstractPlatfor…
Browse files Browse the repository at this point in the history
…m (DBAL)
  • Loading branch information
guilhermeblanco authored and morozov committed Nov 2, 2019
1 parent 7900a0e commit 0ff4d9b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 0ff4d9b

Please sign in to comment.