Hi all, i need some help.
I have two table, let's say User and Transaction with this kind of
relation :
User has some common fields :
id
username
password
Transaction :
created_id is a foreign key to model User (id)
modified_id is a foreign key to model User (id) too
how do define the model relation with this kind of situation ?
i put it in this way but it does not work.
User model :
var $hasMany = array(
'Transaction' => array(
'className' => 'Transaction',
'foreignKey' => 'created_id'
),
'Transaction' => array(
'className' => 'Transaction',
'foreignKey' => 'modified_id'
)
);
Transaction model :
var $belongsTo = array(
'User' => array(
'className' => 'User',
'foreignKey' => 'created_id'
),
'User' => array(
'className' => 'User',
'foreignKey' => 'modified_id'
)
);
Tks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---