Monday, July 12, 2010

Re: consulting associations, post comments users commentaries

Sorry for the late, Thanks!!!

On 8 jul, 11:49, Shaz <shazam...@gmail.com> wrote:
> User hasMany Post
> User hasMany Comment
>
> Post hasMany Comment
> Post belongsTo User
>
> Comment belongsTo Post
> Comment belongsTo User
>
> On Jul 6, 4:43 pm, Vinicius Núñez <viniciusnu...@gmail.com> wrote:
>
> > How are you? Which way can I show a post, its comments, and users that
> > commented them? Do you know I'm talking about, don't you? The
> > following example does not work, or at least I don't know how
> > retrieving data I wait for answers, thank you very much!
>
> > <?
> > class Post extends AppModel {
> > var $name = 'Post';
> > var $hasMany = 'Comment';
>
> > }
>
> > ?>
>
> > <?
> > class Comment extends AppModel {
> > var $name = 'Comment';
> > var $belongsTo = 'User';
>
> > }
>
> > ?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate