On Nov 7, 12:34 am, Brenton B <[EMAIL PROTECTED]> wrote:
> Where there is only 1 level in the 'contain':
>
> SELECT `Photographer`.`id`, `Photographer`.`first_name`,
> `Photographer`.`last_name`, `Photographer`.`company_name`,
> `Photographer`.`email`, `Photographer`.`telephone`,
> `Photographer`.`address_1`, `Photographer`.`address_2`,
> `Photographer`.`country_id`, `Photographer`.`state_id`,
> `Photographer`.`city`, `Photographer`.`zip_code`,  [[[... plus a bunch
> of other fields ... ]]]  `Country`.`id`, `Country`.`name`,
> `Country`.`created`, `Country`.`created_by`, `Country`.`modified`,
> `Country`.`modified_by`, `State`.`id`, `State`.`name`,
> `State`.`country_id`, `State`.`created`, `State`.`created_by`,
> `State`.`modified`, `State`.`modified_by` FROM `photographers` AS
> `Photographer` LEFT JOIN `countries` AS `Country` ON
> (`Photographer`.`country_id` = `Country`.`id`) LEFT JOIN `states` AS
> `State` ON (`Photographer`.`state_id` = `State`.`id`) WHERE
> `Photographer`.`id` = 1 LIMIT 1
>
> SELECT `PrintSize`.`id`, `PrintSize`.`name`, `PrintSize`.`created`,
> `PrintSize`.`created_by`, `PrintSize`.`modified`,
> `PrintSize`.`modified_by`, `PhotographersPrintSize`.`id`,
> `PhotographersPrintSize`.`photographer_id`,
> `PhotographersPrintSize`.`print_size_id`,
> `PhotographersPrintSize`.`price`, `PhotographersPrintSize`.`comment`,
> `PhotographersPrintSize`.`created`,
> `PhotographersPrintSize`.`created_by`,
> `PhotographersPrintSize`.`modified`,
> `PhotographersPrintSize`.`modified_by` FROM `print_sizes` AS
> `PrintSize` JOIN `photographers_print_sizes` AS
> `PhotographersPrintSize` ON
> (`PhotographersPrintSize`.`photographer_id` = 1 AND
> `PhotographersPrintSize`.`print_size_id` = `PrintSize`.`id`) WHERE 1 =
> 1
>
> Then as soon as I add in the extra level in 'contain' I get the above,
> plus these extras:
>
> SELECT `Country`.`id`, `Country`.`name`, `Country`.`created`,
> `Country`.`created_by`, `Country`.`modified`, `Country`.`modified_by`
> FROM `countries` AS `Country` WHERE `Country`.`id` = 2
>
> SELECT `State`.`id`, `State`.`name`, `State`.`country_id`,
> `State`.`created`, `State`.`created_by`, `State`.`modified`,
> `State`.`modified_by` FROM `states` AS `State` WHERE `State`.`id` = 2
>
> I'm hoping to have some time tonight to really dig through the
> Containable behaviour code.

That looks like a great candidate for a test case.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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