Created
June 23, 2014 21:10
-
-
Save derekperkins/0093f9165be24e383ad3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 TeamRoleBehavior extends ModelBehavior { | |
// Enable custom finds in Behavior | |
public $mapMethods = array( | |
'/teamAncestors/' => 'teamAncestors', | |
'/teamDescendants/' => 'teamDescendants', | |
); | |
public function setup(Model $Model, $config = array()) { | |
$Model->findMethods['teamAncestors'] = true; | |
$Model->findMethods['teamDescendants'] = true; | |
} | |
public function findTeamAncestors($Model, $state, $query, $results = array()) { | |
... | |
} | |
public function findTeamDescendants($Model, $state, $query, $results = array()) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment