Just like in codeigniter model class, can we have multiple methods calling different tables in zend framework model that extends zend_db_table_abstract ?
protected $_name = table_name
when defining table name like that, Is there a way to query multiple table having no affect of that protected property ? I am mainly concern about this because I want to have model for homepage which will deal with frontend website and fetch data from different table so that i don't have to touch backend db-table models.
You can also access the DB adapter member in the table and query it directly, specifying a table name of your choice.
For instance, for a select, you can do something like the following:
$select = $this->getAdapter()->select();
$select->from('tableName', $fields);
// ...
$results = $this->getAdapter()->fetchAll($select);
Hope that helps,
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