setAttribute( Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE ); $manager->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, TRUE ); $manager->setAttribute( Doctrine::ATTR_USE_NATIVE_ENUM, TRUE ); /* $manager->setCollate('utf8_unicode_ci'); $manager->setCharset('utf8'); */ $graydonConn = Doctrine_Manager::connection('mysql://'.MYSQL_USER.':'.MYSQL_PASS.'@'.MYSQL_HOST.'/graydon', 'graydon'); Doctrine::loadModels(realpath(dirname(__FILE__)).'/models/graydon'); $intersudConn = Doctrine_Manager::connection('mysql://'.MYSQL_USER.':'.MYSQL_PASS.'@'.MYSQL_HOST.'/intersud', 'intersud'); Doctrine::loadModels(realpath(dirname(__FILE__)).'/models/intersud'); $sdv1Conn = Doctrine_Manager::connection('mysql://'.MYSQL_USER.':'.MYSQL_PASS.'@'.MYSQL_HOST.'/sdv1', 'sdv1'); Doctrine::loadModels(realpath(dirname(__FILE__)).'/models/sdv1'); /* $connection->setCollate('utf8_unicode_ci'); $connection->setCharset('utf8'); */ function setDbConn($name){ global $manager; $currentName = $manager->getCurrentConnection()->getName(); $currentConn = $manager->getCurrentConnection(); if($currentName != $name){ //$manager->closeConnection($currentConn); $manager->setCurrentConnection($name); Doctrine::loadModels(realpath(dirname(__FILE__)).'/models/'.$name); } } ?>