I need help. I created a custom module in magento that needs to interact with multiple tables.
I used the following to get table names
<entities>
<support1>
<table>table1</table>
</support1>
<support2>
<table>table2</table>
</support2>
<support3>
<table>table3</table>
</support3>
</entities>
Then I added to my model
following: public function _construct()
{
parent::_construct();
$this->_init('support/support1');
$this->_init('support/support2');
$this->_init('support/support3');
}
In mysql4 folder i have ...
public function _construct()
{
$this->_init('support/support1', 'ticket_id');
$this->_init('support/support2', 'dept_id');
$this->_init('support/support3', 'priority_id');
}
And in Collection.php I have ...
public function _construct()
{
parent::_construct();
$this->_init('support/support1');
$this->_init('support/support2');
$this->_init('support/support3');
}
So using
$collection = Mage::getModel('support/support')->getCollection();
How can I determine access to support1 or support2, etc. I tried using ...
$collection = Mage::getModel('support/support1')->getCollection();
and
$collection = Mage::getModel('support/support')->getCollection('support1');
but both failed, how should this work?
Thanks in advance.
source
share