Skip to content

Instantly share code, notes, and snippets.

@jaredhoyt
Created November 15, 2010 16:14
Show Gist options
  • Save jaredhoyt/700524 to your computer and use it in GitHub Desktop.
Save jaredhoyt/700524 to your computer and use it in GitHub Desktop.
Pagination deep relational sorting
# Controller -
<?php
$this->paginate = array(
'limit' => 50,
'contain' => array(
'ExceptionWorkflowLog',
'Procedure(id,cpt,expected_amount,allowed_total,difference_amount)',
'Procedure.Claim(id,number)',
'Procedure.Claim.Group(abbr)',
'Procedure.Payer(abbr)'
)
);
$this->set('exceptions', $this->paginate('PaymentException'));
?>
# View -
<?php echo $this->Paginator->sort('Payer', 'Procedure.Payer.abbr'); ?>
# Relationships -
PaymentException belongsTo Procedure
Procedure belongsTo Payer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment