Skip to content

Instantly share code, notes, and snippets.

@mikesimons
Created September 15, 2010 10:14
Show Gist options
  • Save mikesimons/580512 to your computer and use it in GitHub Desktop.
Save mikesimons/580512 to your computer and use it in GitHub Desktop.
<?php
class People extends Iammike_Db_Table_Abstract {
protected $_name = 'people';
// $select is an instance of Iammike_Db_Table_Select
// The rest of the params are what was passed to the finder
public function oldFinder($select) {
return $select->where('people.age > 60');
}
public function youngFinder($select) {
return $select->where('people.age < 20');
}
public function withDocumentsFinder($select) {
return $select->join(array("d" => 'documents'), "d.people_id = people.id", array());
}
public function maleFinder($select) {
return $select->where('people.sex = "m"');
}
public function femaleFinder($select) {
return $select->where('people.sex = "f"');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment