Skip to content

Commit

Permalink
#881 DDC-2825 - correcting PHP mapping behavior when using implicit s…
Browse files Browse the repository at this point in the history
…chema in table name
  • Loading branch information
Ocramius committed Jan 14, 2015
1 parent 0fd51cf commit 51bf82b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,11 @@ public function setTableName($tableName)
public function setPrimaryTable(array $table)
{
if (isset($table['name'])) {
// Split schema and table name from a table name like "myschema.mytable"
if (strpos($table['name'], '.') !== false) {
list($this->table['schema'], $table['name']) = explode('.', $table['name'], 2);
}

if ($table['name'][0] === '`') {
$table['name'] = trim($table['name'], '`');
$this->table['quoted'] = true;
Expand Down

0 comments on commit 51bf82b

Please sign in to comment.