In the Cake Book and the Cake api 'page' is listed as a possible
option for find queries. Neither place really explains what that is. I
assumed it would serve as a manual way of dealing with pagination.
Since I couldn't figure out how to make the paginator work with my
site's architecture, I was trying to use containable to limit/paginate
for me. I thought if I had 'limit' => 10 and 'page' => 2 I'd get rows
11 -20. If that is the intent of the page option, it doesn't seem to
work with containable. (I haven't tried it outside of a containable
context).

                        return $this->find( "all", array(
                                                'conditions' => 
array('Gallery.id' => $gallery_id),
                                                'contain' => array( 'Photo' => 
array(
                                                                        'order' 
=> 'Photo.created DESC',
                                                                        'limit' 
=> $this->thumbsPerPage,
                                                                        'page' 
=> $page
                                                                )
                                                        )
                                        )
                                );

generates this SQL:

SELECT `Photo`.`page`, `GalleriesPhoto`.`gallery_id`,
`GalleriesPhoto`.`photo_id`
FROM `photos` AS `Photo`
JOIN `galleries_photos` AS `GalleriesPhoto` ON
(`GalleriesPhoto`.`gallery_id` = 7 AND `GalleriesPhoto`.`photo_id` =
`Photo`.`id`)
WHERE 1 = 1   ORDER BY `Photo`.`created` DESC   LIMIT 12

As you can see it is trying to put 'page' in as if I had said 'fields'
=> array('page') and completely ignoring the value of $page. There is
no 'page' column in Photo so naturally the query is failing. If I pull
out the page option, the query runs just fine, but I have obviously
lost the ability to index into the rows.

Is this a bug? Have I misunderstood something? Is there a ridiculous
typo here that I'm not seeing?

-Sean

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to