Example:
class Products extends Zend_Db_Table_Abstract
{
protected $_name = 'products';
protected $_referenceMap = array(
'Bug' => array(
'columns' => array('bug_id'),
'refTableClass' => 'Bugs',
'refColumns' => array('bug_id')
)
);
}
$object = new Products();
$select = $object->select()->from()->Join('Bug');
Instead of defining the full join statement
As far as I can tell $_referenceMap is not used in that way. $_referenceMap defines the relationship that a table row has with other tables.
That’s why the associated findDependentRowset(), findManyToManyRowset() and findParentRow() are found in Zend_db_Table_Row_Abstract. These methods create the Joins.
So to get the dependent rows from Bugs, using a select object, you would do something like this, assuming that Products has a one-to-many relationship with Bugs;
To get dependent rows you first have to fetch a parent row.
You can refine the join by using Zend_Db_Select
Finally querying the dependent rows by passing in the select object instead instead of a rule key.
I think this will work, I’ll have to check tomorrow morning.