views:

43

answers:

1

I will have publications (news papers), under these publications there will be editions [location and language] and under these there will be offers and offers will have products.

currently i have created all as modules i.e. publication to add / edit /delete publication, edition to add / edit/ update editions and so on. the problem is how can i get list of all publication when I am creating a edition and same way how can i get list of edition and publication when i am creating a offer.

please help/

regards, saurabh

+1  A: 

You do it like you would in any other ORM/Database based web application.

You need to store the IDs for each related entity type in the database, either by adding properties/columns to your base model to store the IDs, or using an id/id look-up table. Then you'd add methods to each of your Models to load the related models as a collection and/or array of Objects using the stored information. You might some some help in the Zend_Db classes for doing many to many lookups.

Magento's ORM has some kind of support for including Models that are linked to Models, but nothing magic for including Models that are linked to multiple models (or nothing I know of for sure).

Alan Storm
Thanks Alan, I created this module and is on hold for some time.
Saurabh