Skip to content

Commit

Permalink
explicitly define callable methods
Browse files Browse the repository at this point in the history
It's an easy-win performance gain (by avoiding the use of reflections)
  • Loading branch information
AD7six committed Nov 10, 2013
1 parent 470d671 commit 8569323
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Cake/Model/Behavior/TimestampBehavior.php
Expand Up @@ -110,6 +110,32 @@ public function implementedEvents() {
return array_fill_keys(array_keys($this->_settings['events']), 'handleEvent');
}

/**
* implementedFinders
*
* This behavior does not implement any finders
*
* @return array
*/
public function implementedFinders() {
return [];
}

/**
* implementedMethods
*
* Only the timestamp method is callable from a table.
*
* @return void
*/
public function implementedMethods() {
if (isset($this->_settings['implementedMethods'])) {
return $this->_settings['implementedMethods'];
}

return ['timestamp' => 'timestamp'];
}

/**
* Get or set the timestamp to be used
*
Expand Down

0 comments on commit 8569323

Please sign in to comment.