This commit is contained in:
parent
68d12596ce
commit
edfd9f6506
@ -1164,6 +1164,31 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fetches all plugins recursively for given table
|
||||||
|
*
|
||||||
|
* @param Doctrine_Table $table table object to retrieve the plugins from
|
||||||
|
* @return array an array of Doctrine_Plugin objects
|
||||||
|
*/
|
||||||
|
public function getAllPlugins(Doctrine_Table $table)
|
||||||
|
{
|
||||||
|
$plugins = array();
|
||||||
|
|
||||||
|
foreach ($table->getTemplates() as $name => $template) {
|
||||||
|
$plugin = $template->getPlugin();
|
||||||
|
|
||||||
|
if ($plugin === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$plugins[] = $plugin;
|
||||||
|
|
||||||
|
$plugins = array_merge($plugins, $this->getAllPlugins($plugin->getOption('pluginTable')));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $plugins;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportPluginsSql
|
* exportPluginsSql
|
||||||
* exports plugin tables for given table
|
* exports plugin tables for given table
|
||||||
@ -1175,13 +1200,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
foreach ($table->getTemplates() as $name => $template) {
|
foreach ($this->getAllPlugins($table) as $name => $plugin) {
|
||||||
$plugin = $template->getPlugin();
|
|
||||||
|
|
||||||
if ($plugin === null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$table = $plugin->getOption('pluginTable');
|
$table = $plugin->getOption('pluginTable');
|
||||||
|
|
||||||
// Make sure plugin has a valid table
|
// Make sure plugin has a valid table
|
||||||
|
Loading…
Reference in New Issue
Block a user