Skip to content

Commit

Permalink
Don't merge events
Browse files Browse the repository at this point in the history
This is one of the exceptions where merging is not likely to be the
desired behavior - it would mean that you can't configure to disable
default events, it'd require code calls
  • Loading branch information
AD7six committed Mar 27, 2014
1 parent c038ebf commit b1350df
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Model/Behavior/TimestampBehavior.php
Expand Up @@ -58,6 +58,23 @@ class TimestampBehavior extends Behavior {
*/
protected $_ts;

/**
* Constructor
*
* If events are specified - do *not* merge them with existing events,
* overwrite the events to listen on
*
* @param Table $table The table this behavior is attached to.
* @param array $config The config for this behavior.
*/
public function __construct(Table $table, array $config = []) {
parent::__construct($table, $config);

if (isset($config['events'])) {
$this->config('events', $config['events'], false);
}
}

/**
* handleEvent
*
Expand Down

0 comments on commit b1350df

Please sign in to comment.