ZF-6682: Zend_Db_Table_Abstract + Custom RowClass + Zend_Loader_Autoloader_Resource = Fail to load Custom RowClass

Description

Zend_Db_Table_Abstract is not friendly with Zend_Loader_Autoloader_Resource when defining a custom Row Class. The Zend_Loader::loadClass($this->_rowClass); tries to load the Row Class and fails/throws exception.


class DbTable_Test extends Zend_Db_Table
{
   protected $_rowClass = 'Row_Test';
}

Workaround:


// Let the Zend_Loader_Autoloader_Resource load it prior to DbTable usage
new Row_User();

// DbTable stuff
$db = new DbTable_Test();
$select = $db->select()->where('id = ?', 1);
$row = $db->fetchRow($select);

// Row_Test should have loaded correctly / not thrown exception
Zend_Debug::dump($row);

Comments

This duplicates ZF-2533 (and roughly 6-8 other similar or same issues), and is already resolved in trunk and the 1.8 release branch. Changes will release with 1.8.2.