Hi Brian
Have a look at the Conditions section of the Model page in the manual.
It will give you a thorough explanation of how to construct the kind of
complex conditions statement that you want (hint, this would use an SQL
"IN" condition - which the manual covers).
Given what you are trying to do I expect that you will have to rework it
to get the right structure to use in the conditions. There may be an
automagical way in Cake to convert a result set to a conditions array,
but I don't know it. I just loop over the array and reform the data the
way that I need it.
Regards,
Langdon
Brian Hartvigsen wrote:
> I have 3 models, Group, User, Referral. Group hasMany User, User
> hasMany File.
>
> I have some Users that I want to be able to see all Files for other
> Users in their Group. Right now I'm trying to do this with
> $users = $this->User->findAll('group_id = ' . $User['group_id']);
> $this->File->findAll(array('File.user_id' => $users));
>
> Obviously this isn't working. The $users array is in the wrong format
> for use in a conditions statement (even if I restrict it to grabbing
> id only in the first findAll.) Am I expecting to much here or simply
> going about this the wrong way?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---