Well, when you run this query using cake, what is the value of the
main condition => 'MixtureCategory.slug'=>$slug ?
If you set debug = 2, what do you get in the sql log ?
On Oct 12, 10:07 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm experiencing something unexpected with a containable within a
> find('first') - here's my code:
>
> $this->data = $this->Mixture->MixtureCategory->find('first', array(
> 'conditions'=>array('MixtureCategory.slug'=>$slug,
> 'MixtureCategory.status'=>1),
> 'recursive'=>2,
> 'contain'=>array(
> 'BannerImage',
> 'Mixture'=>array('BannerImage',
> 'conditions'=>array('Mixture.status'=>1)),
> 'ParentMixtureCategory'=>array('BannerImage'),
> 'ChildMixtureCategory'=>array('BannerImage',
> 'Mixture'=>array('conditions'=>array('Mixture.status'=>1)))
> )
> ));
>
> This outputs a few queries, one of which is:
>
> SELECT `BannerImage`.`id`, `BannerImage`.`document_category_id`,
> `BannerImage`.`model`, `BannerImage`.`foreign_key`,
> `BannerImage`.`name`, `BannerImage`.`description`,
> `BannerImage`.`meta_title`, `BannerImage`.`meta_keywords`,
> `BannerImage`.`meta_description`, `BannerImage`.`extension`,
> `BannerImage`.`mime_type`, `BannerImage`.`filesize`,
> `BannerImage`.`md5`, `BannerImage`.`allow_delete`,
> `BannerImage`.`status`, `BannerImage`.`created`,
> `BannerImage`.`modified`, `BannerImagesMixtureCategory`.`id`,
> `BannerImagesMixtureCategory`.`mixture_category_id`,
> `BannerImagesMixtureCategory`.`document_id` FROM `documents` AS
> `BannerImage` JOIN `banner_images_mixture_categories` AS
> `BannerImagesMixtureCategory` ON
> (`BannerImagesMixtureCategory`.`mixture_category_id` = 5 AND
> `BannerImagesMixtureCategory`.`document_id` = `BannerImage`.`id`)
> WHERE 1 = 1
>
> This shows no records found in the SQL log - but when i run the exact
> query above in phpmyadmin the record i expect is found.
>
> Any ideas?
>
> Thanks,
>
> Jon
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---