Hi there,

I wrote an application in ZF1.7 with a modular structure that made extensive use of the db_table magic methods. To illustrate, here's part of the structure of my app:

- application
        - modules
                - default
                        - models
                                - Content.php
                - pages
                        - controllers
                                - IndexController.php
                        - models
                                - Page.php

Both models, page and content, are extended from dbTable and content is a dependent table of page.

In 1.7 could just write (paraphrasing a bit here):

        $page = new Page() ;
        $content = $page->findContentByPage() ;

Whereas now, having upgraded my app to use Zend_Application under 1.9.2 with the same modular structure, I now have to write:

        $page = new Pages_Model_Page() ;
        $content = $page->findDependentRowset('Default_Model_Content','Page') ;

Which is much more verbose and, IMHO, less elegant than before. Don't even get me started on the replacement for the "many to many" "via" magic method.

Is the implication here that magic methods are going to be phased out, or am I missing something/doing something wrong?

I then considered putting all of my models in a central folder directly beneath the main application folder so that I could drop the <module>_Model_ bit of the model name and hence use the magic methods again but couldn't get Zend_Application to "see" that models directory in any way... any pointers here?

Many thanks, and sorry for ranting a bit!

Mike Thirlwell

Reply via email to