Hi all,

I'm really new to Zend, so please forgive me if the question seems silly

I have a table called Employees which has a one to one relationship with
table Positions.
My employees model look like this:


class Employees extends Zend_Db_Table
{
    protected $_name = 'employees';
    protected $_primary = 'id';
    
    protected $_dependentTables = array('positions');
    
    protected $_referenceMap = array(
        'Position' => array(
                'columns'               => array('position_id'),
                        'refTableClass' => 'Positions',
                        'refColumns'    => array('title')
                        )
                );
        
}

I wonder if there is any way that I can set 
$employees = new Employees();
$employees->fetchAll(); 
to automatically get the corresponding 'title' field from table Positions.

I know I can manually write query for it, but the what is the point of the
referenceMap?

Thanks all

Raine
-- 
View this message in context: 
http://www.nabble.com/Automatically-query-related-field-from-another-table--tp19802303p19802303.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to