trying to set up a config file for a custom module - do I need to have a unique model for each 'resourceModel', or is it possible to have multiple table entities per model?
Is it possible to get something like this to work:
<config>...
<model>
<namespace>
<class>Namespace_Module_Model</class>
<resourceModel>module_mysq4</resourceModel>
</namespace>
<module_mysql4>
<class>Namespace_Module_Model_Mysql4</class>
<entities>
<table_1>
<table>table_1</table>
</table_1>
<table_2>
<table>table_2</table>
</table_2>
<table_3>
<table>table_3</table>
</table_3>
...
</entities>
</module_mysql4>
..</config>
and then dynamically switch between the tables through the model?
and related: Anyone know what the possible children of the are and their properites? I've seen 'entities', 'associations' and 'items' - thx
It's not really clear what you're asking here. Magento has a basic one resource to one table resource, and a one resource to many tables constructed in a specific manner resource for EAV style models.
The scenario you're describing above isn't directly supported by the system, but if you wanted to implement something like it there's nothing stopping you from implementing a resource that works any way you want.
As for the possible children, create the simple config viewer described here to get a dump of the entire merged config, and then use an xpath viewer to examine all the nodes (and their children) that you're interested in
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With