Changeset 3953

Show
Ignore:
Timestamp:
03/08/08 08:30:56 (16 months ago)
Author:
jwage
Message:

Added autoload when getting table for component to ensure the model is present and loaded before this happens.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Manager.php

    r3937 r3953  
    537537     * @return Doctrine_Connection 
    538538     */ 
    539     public function getConnectionForComponent($componentName = null) 
    540     { 
     539    public function getConnectionForComponent($componentName) 
     540    { 
     541        Doctrine::autoload($componentName); 
     542 
    541543        if (isset($this->_bound[$componentName])) { 
    542544            return $this->getConnection($this->_bound[$componentName]); 
    543545        } 
     546 
    544547        return $this->getCurrentConnection(); 
    545548    } 
     
    581584    public static function table($componentName) 
    582585    { 
    583         return Doctrine_Manager::getInstance() 
    584                ->getConnectionForComponent($componentName) 
    585                ->getTable($componentName); 
     586        $manager = Doctrine_Manager::getInstance(); 
     587        return $manager->getConnectionForComponent($componentName)->getTable($componentName); 
    586588    } 
    587589