Changeset 3457
- Timestamp:
- 02/14/07 18:59:51 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfDoctrinePlugin/lib/sfDoctrine.class.php
r3441 r3457 21 21 static public function connection($connection = null) 22 22 { 23 sfContext::getInstance()->getLogger()->err('The sfDoctrine::connection() method is deprecated'); 24 if($connection === null) 23 if ($connection === null) 25 24 { 26 $connection = sfConfig::get('sf_default_database', null); 27 if($connection === null) 28 { 29 $error = 'To use sfDoctrine::connection() with no argument you must specify a default connection default_database in settings.yml'; 30 throw new sfDatabaseException($error); 31 } 25 return Doctrine_Manager::getInstance()->getCurrentConnection(); 32 26 } 33 27 34 return sfContext::getInstance()->getDatabaseConnection($connection);28 return Doctrine_Manager::getInstance()->getConnection($connection); 35 29 } 36 30 plugins/sfDoctrinePlugin/lib/sfDoctrineDatabase.class.php
r3437 r3457 25 25 { 26 26 parent::initialize($parameters); 27 28 // if a default connection is defined we only open that one 29 if ($defaultDatabase = sfConfig::get('sf_default_database')) 30 { 31 if ($name != $defaultDatabase) 32 { 33 return; 34 } 35 } 27 36 28 37 // load doctrine config