CakePHP does not build JOINs for hasMany You can use containable behavior to pass conditions to related models.
p.s. There is a trick to force cake to build JOINs, but you should investigate containable first. On Sep 24, 2:48 pm, Sax <[EMAIL PROTECTED]> wrote: > Cake Version: 1.2.0.7296 RC2 > > Thanks ahead of time for your help. I have a Model that BelongsTo > three other models, it also has three HasMany relationships All models > are "used" in my controller. > > I want to do a find where I limit the results by a field in one of the > HasMany models and a couple fields in the BelongsTo models. The > problem is that the HasMany model is not joined on the SQL statement > and I get an error like this: > > $error = "1054: Unknown column 'VendorUnavailability.date' in 'where > clause'" > > I scoured the api, docs and google groups for an acceptable answer, > but none were precise and pass the simple test. What is the best way > to get the results Im looking for without complex Cake hacking. This > is a simple SQL statement that I'd rather not do manually. If more > information is needed, I can provide it, but I'm trying to limit the > amount of verbose code on here. > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---