1
0
mirror of synced 2024-12-14 07:06:04 +03:00

Fixed connection binding so it is only put in the base class.

This commit is contained in:
Jonathan.Wage 2007-11-15 23:22:18 +00:00
parent 6db25011a7
commit 85ef90fd02

View File

@ -684,6 +684,7 @@ END;
$topLevel['no_definition'] = true;
$topLevel['generate_once'] = true;
$topLevel['is_main_class'] = true;
unset($topLevel['connection']);
// Package level definition that extends from the base definition
if (isset($options['package'])) {
@ -696,6 +697,7 @@ END;
$packageLevel['override_parent'] = true;
$packageLevel['generate_once'] = true;
$packageLevel['is_package_class'] = true;
unset($packageLevel['connection']);
}
$baseClass = $options;
@ -807,19 +809,9 @@ END;
$writePath = $this->_path . DIRECTORY_SEPARATOR . $fileName;
}
$code = "<?php" . PHP_EOL;
if (isset($options['requires'])) {
if ( ! is_array($options['requires'])) {
$options['requires'] = array($options['requires']);
}
foreach ($options['requires'] as $require) {
$code .= "require_once('".$require."');\n";
}
}
if (isset($options['connection']) && $options['connection']) {
$code .= "// Connection Component Binding\n";
$code .= "Doctrine_Manager::getInstance()->bindComponent('" . $options['connectionClassName'] . "', '" . $options['connection'] . "');\n";