Link to home
Start Free TrialLog in
Avatar of jagguy
jagguyFlag for Australia

asked on

pagination and joins

Hi,  I can use paginate as follows.
I cant understand why you need to use joins in paginate if the models are related in cakephp? Doesnt the join happen automatically?

In what case would I need to define a join in a paginate  for related models? You can even use the conditions clause (where) to specify what records to display in paginate. There need for a join statement has stumped me and the docs dont explain this

http://book.cakephp.org/2.0/en/core-libraries/components/pagination.html


$this->paginate = array(
        'limit' => 3,
        'order' => array('Student.id' => 'ASC','Student.first_name' => 'ASC'),
        'contain' => array('TutoringType','Referral')    
         );
      $this->set('students',  $this->paginate());
ASKER CERTIFIED SOLUTION
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial