Morning TWIOF,
You might want to look at your level of recursion for your blog model.
If the associations are in place correctly you should be able to
retrieve all of the related images when you do a findAll on your blog
model.
try
$this->Blog->recursive = 2;
in your controller or
$recursive = 2;
in the attribute definition portion of your model.
HTH,
mikee
On 14/11/06, TWIOF <[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I've got a custom model function that gets titles to blog posts (and
> their "belongs to" data e.g. author). I have related images as
> "hasMany" but can't call them in a simple fashion...
>
> I'm using this in the model:
>
> $fields = array('blog.title', 'blog.date', 'author.name');
> return $this->findAll($conditions, $fields, $order, $limit, null, 0);
>
> This doesn't retrivev data from "hasMany" models, so then I use
> another function in the Images model to get the relevant images.
>
> Is there a way to do it all in the blogs model? Or have I done
> something wrong?
>
> Thanks in advance
>
> TWIOF
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---