First make sure that the User model has $actsAs = array('Containable')
set.
This might do the trick:

// app/controllers/users_controller.php
$this->User->find('first', array( // --> Use 'first' if you're only
looking for one user, and 'all' if you want all users who match
specified conditions.
    'conditions' => array('User.id' => $user['User']['id'])   // -->
or whatever other condition you use to find a specific user..
    'contain' => array(
        'Book' => array('Author')
    )
));

I'm still playing around with all the new goodies that the Containable
behavior has to offer, so I'm not quite certain how the behavior will
react to a second-level embedding of two HABTM relationships.

Take a look at the Containable behavior test cases; since there is no
official documentation on this, it's the best source of information
and examples.

On Jun 23, 6:26 am, "gbk *" <[EMAIL PROTECTED]> wrote:
> hi guys
>
> i have the following model structure:
>
> User HABTM Book
> Book HABTM Author
>
> i would like to find all the books of the user, but with the Authors.
>
> how can i implement it with the Containable behavour?
>
> thanks,
>
> gbk
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to