1
0
mirror of synced 2025-01-19 06:51:40 +03:00

#881 DDC-2825 - correcting PHP mapping behavior when using implicit schema in table name

This commit is contained in:
Marco Pivetta 2015-01-14 17:54:00 +01:00
parent 0fd51cf852
commit 51bf82b7e7

View File

@ -2246,6 +2246,11 @@ class ClassMetadataInfo implements ClassMetadata
public function setPrimaryTable(array $table) public function setPrimaryTable(array $table)
{ {
if (isset($table['name'])) { 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] === '`') { if ($table['name'][0] === '`') {
$table['name'] = trim($table['name'], '`'); $table['name'] = trim($table['name'], '`');
$this->table['quoted'] = true; $this->table['quoted'] = true;