ZF-6611: Zend DbTable Row Class name->path problem

Description

I was using Zend_Application_Module_Autoloader to autoload my resources. I created two classes one extending Zend_Db_Table_Abstract (Users) and the other is a custom row class extending Zend_Db_Table_Row_Abstract (User).

When instantiating these class separately there is no problem. However when I use Table class like with a custom row like the one below. It cant find the file. It looks in "model" directory instead of "models";

class Model_DbTable_Users extends Zend_Db_Table_Abstract { protected $_name ='user'; protected $_primary = 'id'; protected $_rowClass = 'Model_DbTable_User'; }

I am guessing there is a separate Namespace/path converter somewhere else and it is converting differently than Autoloader. This may be helpful \library\Zend\Db\Table\Rowset\Abstract.php(119): Zend_Loader::loadClass('Model_DbRow_Use...')

There is a discussion about this at http://nabble.com/Zend-Model-and-quickstart-tt2344…

Comments

The problem is not that it's looking in the wrong directory so much as it's not using autoloading -- which is an issue throughout the framework currently. We'll be addressing it soon.

Any tips on how to fix this?

Resolved in trunk and 1.8 release branch

I downloaded the from the trunk to give it a try. As you said it now works. However there is another problem (or I'm doing something wrong) which may be related.

Anyway: It seems that even if you set a new rowClass in the table class when you return it, thr returned object is still Zend_Db_Table_Row Object instead of the custom class.

Doesnt work... // Specify a custom Row to be used by default // in all instances of a Table class. class Products extends Zend_Db_Table_Abstract { protected $_name = 'products'; protected $_rowClass = 'MyRow'; }

Does Work // Or specify a custom Row to be used in one // instance of a Table class. $bugs = new Bugs(array('rowClass' => 'MyRow'));