Hi,

I think you need to try Tree behavior, please have a look at
http://book.cakephp.org/view/1339/Tree

Hope this helps.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Thu, Jan 20, 2011 at 1:14 PM, josef corley <[email protected]> wrote:

> Howdy. ^^
>
> I'm a noob at this so, please bear with me.. ^_^
>
>
> I have these following tables with their corresponding associations:
>
> Users-
>          id, username, password,username, email, website,
> date_registered, name, role_id, last_name, first_name, about
>       hasMany=Post,Comment
>
> Posts-
>      id,       author_id ,     date_posted ,   content ,       title,
>  date_modified ,
> published
>      belongsTo=User=>
>           foreignKey=>author_id
>
>      hasMany=Comment
>
>
> Comments-
>     id ,       post_id ,       date ,  content ,approved ,     agent ,
> user_id ,
> parent_id
>     belongsTo=Post,
>              'User'=>
>                 foreignkey=>user_id
>
>
>
>
>
>
> Now if, for example, a registered-user wants to reply to a COMMENT,
> that is under a POST, (like in youtube, where when you click "Reply"
> in the side of another COMMENt by another registered-user, your
> comment will be indented, making the Comment where you've clicked
> "Reply",, the parent of your comment right?)
>
> is putting the "parent_id" inside the comments table good enough?,
> I've been thinking about this for hours now, sorry for the noobness.
> ^_^
>
> if it is good enough, how do I make a table associate with itself...
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to