On Feb 26, 10:46 am, Gianluca Gentile <[email protected]>
wrote:
> I want to use pagination with this conditions (for example):
>
> Site.category_id = '1' AND Tag.id = '1' OR Tag.id = '2'
Try:
var $paginate = array('conditions' => array('AND' => array
('Site.category_id' => 1, 'OR' => array('Tag.id' => 1, 'Tag.id' =>
2))), 'recursive' => 0);
You may want to specify what fields you want in there as well by
specifying an additional sub-array called 'fields'. For example:
var $paginate = array('fields' => array('Site.title',
'Site.description', 'Site.vote', 'Tag.tag'), 'conditions' => array
('AND' => array('Site.category_id' => 1, 'OR' => array('Tag.id' => 1,
'Tag.id' => 2))), 'recursive' => 0);
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---