The only problem I am having with this is that userpages are then
received like this:
[Userpage] => Array
(
[0] => Array
(
[id] => 2
[filename] => helloworld.html
[type] => text/html
[size] => 34
[approved] => 0
[user_id] => 130
[created] => 2009-08-13 23:13:55
[content] =>
Is without knowing how many userpages a user has, how can I get the
the actual userpage data (id, etc).
Thanks,
~Sarah
On Aug 27, 3:19 pm, delocalizer <[email protected]> wrote:
> Hi Sarah;
> If your relationships are set up correctly and you have recursive >
> -1, the usual 'find' method on User model should be returning the
> parent 'Animal' anyway - what do you see if you put this in one of
> your user controller functions:
> $example = $this->User->find('first');
> debug($example);
> ?
>
> On Aug 28, 6:01 am, Sarah <[email protected]> wrote:
>
> > This is my setup:
>
> > A 'user' hasMany 'userpage's.
> > A 'user' belongsTo an 'animal'.
>
> > I would like to be able to display user information as well as some
> > information about the user's animal on a userpage view.
>
> > I perform a find query to get the userpage id, user_id, animal_id.
>
> > Is there a way to search for Animal information as well?
> > This won't work because of the last field, but this is conceptually
> > what I want:
>
> > 'fields'=>array('user_id', 'id', 'User.animal_id',
> > 'User.Animal.frontfilename')
>
> > Thanks in advance!
> > ~Sarah
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---