Skip to content
Permalink
Browse files

allow configuring implmenetedMethods/Finders

  • Loading branch information...
AD7six committed Nov 4, 2013
1 parent 4128325 commit e0ce895e8efc8409c06b7f73d4476cf9b1bc09e3
Showing with 10 additions and 2 deletions.
  1. +10 −2 Cake/ORM/Behavior.php
@@ -172,6 +172,10 @@ public function implementedEvents() {
* @return array
*/
public function implementedFinders() {
if (isset($this->_settings['implementedFinders'])) {
return $this->_settings['implementedFinders'];
}
$reflectionMethods = $this->_reflectionMethods();
return $reflectionMethods['finders'];
}
@@ -182,6 +186,10 @@ public function implementedFinders() {
* @return array
*/
public function implementedMethods() {
if (isset($this->_settings['implementedMethods'])) {
return $this->_settings['implementedMethods'];
}
$reflectionMethods = $this->_reflectionMethods();
return $reflectionMethods['methods'];
}
@@ -225,9 +233,9 @@ protected function _reflectionMethods() {
$isFinder = substr($methodName, 0, 4) === 'find';
if ($isFinder) {
$return['finders'][] = $methodName;
$return['finders'][substr($methodName, 4)] = $methodName;
} else {
$return['methods'][] = $methodName;
$return['methods'][$methodName] = $methodName;
}
}

0 comments on commit e0ce895

Please sign in to comment.
You can’t perform that action at this time.