From 51bf82b7e75e677916faf08fa1afa19590e35f93 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 14 Jan 2015 17:54:00 +0100 Subject: [PATCH] #881 DDC-2825 - correcting PHP mapping behavior when using implicit schema in table name --- lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index dfaa40111ce..8d482e84db1 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -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;