Created
September 15, 2010 10:14
-
-
Save mikesimons/580512 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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