开发者

Zend Framework: disable autoloading of base model tables

I use Module Autoloader to autoload resources (forms, Doctrine models etc.). I do not use Zend_Db_Table at all.

When I load any Doctrine model, e.g. MyModule_Model_Test, it tries to load MyModule_Model_TestTable too, so I get errors that the MyModule_Model_TestTable.php is missing.

To fix this, I may create empty class MyModule_Model_TestTable class and everything works as expected.

But I don't need this file.

Strange that, when I move MyModule_Model_TestTable to /anyDirDeeper/MyModule_Model_TestTable without changing its name or content, the class is correctly loaded too…

How to configure Module Autoloader so it would not require this …Table classes?

I have in my application.ini:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = 

And Module Bootstrap:

class MyModule_Bootstrap extends Zend_Application_Module_Bootstrap {}

My app structure is similar to this:

/application/
 开发者_开发百科   /modules/
        /mymodule/
            /models/
                /Db/
                   *Mymodule_Model_Db_Test*
            *Mymodule_Model_Test*


I think this issue was produced because I used the same module name and resource type name (registered by default).

Models were named: Acl_Model_Modelname and Acl_ namespace was registered with autoloader. Changed model namespace to something else and it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜