On 9/4/07, Braindead <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a model 'posts'. 'Post' has and belongs to many 'Comment'.
> 'Comments' belongs to 'Author'. 'Author' comes from my model 'users'.
> Everything is working fine. I can access the post, the comments and
> the author information.

You could do the following:

$conditions = array('Author' => 'GrumpyCanuck');
$posts = $this->Post->find($conditions, array('Post.title', 'Post.status'));

That should only pull back the Post.title and Post.status instead of
all the fields in the Post table.

Fields to return is the second parameter in a find() statement.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to