When using pagination with on the fly binds you need to specify the
last parameter as false to make the bind last for multiple queries.
$this->LocalInfo->bindModel(array('belongsTo'=>array(
'Cat'=>array(
'foreignKey'=>false,
'type'=>'INNER',
'conditions'=>array('Subcat.cat_id = Cat.id')
),
'Location'=>array(
'foreignKey'=>false,
'type'=>'INNER',
'conditions'=>array('Cat.location_id = Location.id')
)
)), false);
When using contain and specifying deep relations they need to be done
as follows
$this->LocalInfo->Behaviors->attach('Containable');
$this->paginate['LocalInfo'] = array(
'contain' => array('Subcat'=>array(
'Cat'=>array(
'Location'
)
)),
'order' => 'LocalInfo.title'
);
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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