Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2008, 03:29 PM
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default Relationship problem

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')
  )
}
so when I want to find the id_a_2 related to a specified id_a, I try this :
Code:
$id_a_2 = $id_a -> find Table_1 Via Table_2 By RefB; (without spaces offcourse)
But the result I get is nothing .....

My database design is correct, so is there some good soul to help me ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:54 PM.