|
|
@@ -59,6 +59,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
|
|
|
*
|
|
|
* There is only one event handler, it can be configured to be called for any event
|