I have tables like these:
human_resources:
id name position_id
------------------------------------
1 Jacko 3
2 Madonna 5
positions:
id label upper_position_id
------------------------------------------------------------
1 President 0
2 Director of Business 1
3 Director of Finance 1
4 Marketing Manager 2
5 Sales 4
*positions.upper_position_id refer to positions.id
My questions:
1. What is the type of relationship between human_resources and positions?
2. How to get all the upper positions when i do find a human_resource?
e.g. HumanResource->find(1) so it will find the position of "Jacko"
and also upper positions of Jacko's.
Thanks in advance.
On 12/23/06, the_woodsman <[EMAIL PROTECTED]> wrote:
Remember as well, if the models are linked in this way you can chain
these calls, to access tables deeper in the relationships:
class Post extends AppModel
{
var $hasOne = 'Author';
function something()
{
/* Here you can access $this->Author->OtherModel->something...
assuming the OtherModel class is linked from the Author model */
}
}
Can be quite handy.
>
--
Regards,
Ananda Putra
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---