|
|||
|
Hi everyone,
I have some problem using Zend_db_relation when I want to get an object id when I use "specify the reference rule". Example of the tables : Table_1 : id_a, name_a Table_2 : id_a_1, id_a_2 Example of table_2 Controller code : Code:
class Tb2 extends Zend_Db_Table_Abstract
{
protected $_name = 'Table_2';
protected $_referenceMap = array(
'RefA' => array(
'columns' => array('id_a_1'),
'refTableClass' => 'Tb1',
'refColumns' => array('id_a')
),
'RefB' => array(
'columns' => array('id_a_2'),
'refTableClass' => 'Tb1',
'refColumns' => array('id_a')
)
}
Code:
$id_a_2 = $id_a -> find Table_1 Via Table_2 By RefB; (without spaces offcourse) My database design is correct, so is there some good soul to help me ? ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
|
|