This might do it:

var $paginate = array(
        'limit' => 20,
        'page' => 1,
        'order'=>array('Client.last_name' => 'ASC'),  // for example
        'fields' => array(
                'Client.id',
                'Client.first_name',
                'Client.last_name',
                'Purchase.id,
                'Purchase.name',
                ...
        )
);

function whatever()
{
$this->paginate(array('Client.first_name' => 'John', 'Purchase.name' => 'car'))
}

On Thu, Mar 6, 2008 at 7:29 AM, dandreta <[EMAIL PROTECTED]> wrote:
>
>  Hi!
>  I have two models:(Client,purchase)
>  One client has many purchases.
>
>  In clients_controller:
>
>  If I want to paginate all clients with name John I do:
>  $this->paginate(array('Client.name' => 'John'))
>
>  But how can I paginate all clients who have bought a certain product
>  (for example, condition: purchase.name='car')?
>
>  Thanks and regards
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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