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 Jan 4, 2018
1 parent 2f9da39 commit 9aa4e79
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 9aa4e79

Please sign in to comment.