[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] Joomla PDO Database Driver

To finish this off-topic part:

In your DoctrineDatabaseProvider you can delete lines 157-169:

// Process all excludes
foreach ($excludes as &$exclude)
// Strip placeholder
if (substr($exclude, 0, 3) == '#__')
$exclude = substr($exclude, 3);

// Add prefix
// TODO: not sure if Doctrine takes care of this
// $exclude = $prefix . $exclude;

In your TablePrefix class you can change the line 53:
$classMetadata->setTableName($this->prefix . $classMetadata->getTableName());
$classMetadata->setTableName(str_replace('#__', $this->prefix, $classMetadata->getTableName()));

and line 60:
$classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName;
$classMetadata->associationMappings[$fieldName]['joinTable']['name'] = str_replace('#__', $this->prefix, $mappedTableName);

In that way you just replace the #__ prefix by the real one, instead of always sticking a prefix in front of the table-name.

Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.