Skip to content

Instantly share code, notes, and snippets.

@azrad
Created January 10, 2013 03:52
Show Gist options
  • Save azrad/4499294 to your computer and use it in GitHub Desktop.
Save azrad/4499294 to your computer and use it in GitHub Desktop.
Enquiry with custom find type
<?php
// the Model
class Enquiry extends AppModel {
public $_findMethods = array('junk' => true);
protected function _findJunk($state, $query, $results = array()) {
if ($state == 'before') {
$query['conditions']['Enquiry.mailbox'] = 'JUNK';
return $query;
}
return $results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment