I think the problem is that Gallery "hasMany" Images  and Image
"belongsTo" Gallery

while:
return $this->Image->findAll(
                "Gallery.id = '$id'",
                array('Gallery.name','Image.filename')
);

works fine. I refer to Gallery model which Image belongs to.

But the other way:
return $this->Gallery->findAll(
                "Gallery.id = '$id'",
                array('Gallery.name','Image.filename')
);

doesn't work. There are many Image model objects for one Gallery.
Maybe I should "address" the fields different ?

I found some addressing examples with '{n}' thing. I don't know what
it means, but I use it in generateList following the example
"{n}.Post.id" and it works.

Maybe I should try it here. I tried:
return $this->Gallery->findAll(
                "Gallery.id = '$id'",
                array('Gallery.name','Image.{n}.filename')
);

and

return $this->Gallery->findAll(
                "Gallery.id = '$id'",
                array('Gallery.name','{n}.Image.filename')
);
but it doesn't work

I've got wxacly the same roblem in another project.

What am I doing wrong?


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