doctrine/doctrine1 — pull request #67 by BeTa-glop (2014-12-19 11:12:27+00:00)
Title: Fix a blocking bug using behaviors and multiple connections

cf. http://www.doctrine-project.org/jira/browse/DC-373

I'm sad 'cause I've been unable to push this directly (but I'm a n00b w/ git, I'm more aware of svn...) into the repository. Maybe next time...

Here is the patch :
Index: Doctrine/Record/Generator.php
===================================================================
--- Doctrine/Record/Generator.php	(révision 4690)
+++ Doctrine/Record/Generator.php	(copie de travail)
@@ -163,7 +163,7 @@
// check that class doesn't exist (otherwise we cannot create it)
if ($this->_options['generateFiles'] === false && class_exists($this->_options['className'])) {
$this->_table = Doctrine_Core::getTable($this->_options['className']);
- return false;
+ //return false;
}

$this->buildTable();
@@ -461,10 +461,10 @@
} else {
throw new Doctrine_Record_Exception('If you wish to generate files then you must specify the path to generate the files in.');
}
- } else {
+ } elseif ( !class_exists($definition['className']) ) {
$def = $builder->buildDefinition($definition);

eval($def);
}
}
}