I'm trying to paginate:
function gather_collections($divisionId, $manufacturerId) {
$this->Collection->bindModel(array('hasOne' =>
array('CollectionsManufacturer')), false);
$this->Collection->recursive = 0;
return $this->paginate($this->Collection->find('all',
array('recursive' => 0, 'fields' => array('Collection.id',
'Collection.name', 'Collection.SmallImage',
'Collection.newcollection'), 'conditions' => array("and" =>
array('CollectionsManufacturer.manufacturer_id'=>
$manufacturerId,'Collection.division_id'=>$divisionId)))));
}
but keep bombing on:
Warning (512): SQL Error: 1054: Unknown column 'Collection' in 'where
clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 512]
$sql = "SELECT COUNT(*) AS `count` FROM `products` AS `Product` LEFT
JOIN `collections` AS `Collection` ON (`Product`.`collection_id` =
`Collection`.`id`) LEFT JOIN `product_types` AS `ProductType` ON
(`Product`.`product_type_id` = `ProductType`.`id`) WHERE `Collection`
IN ('3077055', 'Cast Mosaic Tops', '', 'TopOptions_th.jpg', '121',
'TopOptions.jpg', '0', '1', '0') AND `Collection` IN ('3077056', 'Cast
Tops', '', 'TopOptions_th.jpg', '121', 'TopOptions.jpg', '0', '2',
'0') AND `Collection` IN ('3077057', 'Impression Tops', '',
'TopOptions_t
As you can imagine Collection hasMany Product. But, I don't
understand the need to join to Product in this case and might be the
cause of my error.
Any suggestions?
Todd
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---