Sorry bad choice of model names. This was just a test example not
related to the application I am building.
The main question is if that's the way cakephp returns data from the
HABTM relations. With the join table array for each.
[Join] => Array
(
[id] => 1
[comment_id] => 1
[post_id] => 1
)
Is can I get my data back without this sub array ?
Thank you,
Claudiu
On Jul 15, 9:15 pm, brian <[email protected]> wrote:
> For Post & Comment, you should probably be using belongsTo & hasMany.
> You're unlikely to have comments that can belong to more than one
> Post.
>
> Post hasMany Comment
> Comment belongsTo Post (so, comments table should have a post_id column)
>
> On Wed, Jul 15, 2009 at 1:58 PM, Claudiu
>
> Apetrei<[email protected]> wrote:
>
> > Hello,
>
> > I'm a bit new to cakephp now working on a project and came across
> > HTABM. Did a simple test with a Post model and a comments one.
>
> > Everything works great my only problem is that it also returns for
> > each comment the join table. Is this how it's supose to work ?
>
> > Here is what I get :
>
> > Array
> > (
> > [0] => Array
> > (
> > [Post] => Array
> > (
> > [id] => 1
> > [name] => claudiu
> > [type] => 1
> > )
>
> > [Comment] => Array
> > (
> > [0] => Array
> > (
> > [id] => 1
> > [subiect] => test1
> > [comment] => ss
> > [Join] => Array
> > (
> > [id] => 1
> > [comment_id] => 1
> > [post_id] => 1
> > )
> > )
> > )
> > )
>
> > Thank you,
> > Claudiu
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---