Friday, September 4, 2009

Re: Complex model associations, pagination and containable

On Fri, Sep 4, 2009 at 11:55 AM, Miles J<mileswjohnson@gmail.com> wrote:
>
> No its not.
>
> Error: 1054: Unknown column 'School.city' in 'where clause'
>
> That means you dont have a column named city on your school table/
> model, thats not caused by the containment.

It *appears* that way, yes. But remember that "School" is an alias.

There is no join on schools table here:

FROM `course_results` AS `CourseResult`
LEFT JOIN `courses` AS `Course`
ON (`CourseResult`.`course_id` = `Course`.`id`)
WHERE `Course`.`course_type_id` = 1
AND `School`.`city` = 'London'
AND `School`.`country_id` = '225'
AND ((`CourseLevelMin`.`order` <= '1')
OR (`Course`.`course_level_min` IS NULL))
AND `Course`.`published` = 1
AND `Course`.`deleted` = 0 LIMIT 20

--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: