Cake does a JOIN across belongsTo and hasOne, because there can be
only a single related row (so the results are much easier to
extract).     I thought there was an enhancement ticket on trac to add
this functionality for hasMany, but I can't see it now.

For the time being, yes, if you cannot execute your query sufficiently
from either model, use query() directly.


On Nov 15, 6:52 pm, "marek. bytnar" <[EMAIL PROTECTED]> wrote:
> Very thank You for the answer.
>
> >  The
> > query you had in the middle of your post that "strangely works" is not
> > so strange - you are querying the Photo table, so of course you can
> > use Photo conditions.
>
> I meant, that in this way I can use conditions on both Models - this
> on example should be more correct:
> $this->Realization->Photo->findAll('Photo.id = 59 and Realization.id =
> 1')  will be ok
> but
> $this->Realization->findAll('Photo.id = 59 and Realization.id = 1')
> this one not
>
> What I actually want is to force it to make INNER JOIN as it does it
> in the first case - what as I guess should be provided when I use
> $this->Realization->recursive = 2.
>
> So is the only way to do this Inner Join Model->query() method ?
--~--~---------~--~----~------------~-------~--~----~
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