/** * @inheritdoc */ public function init() { parent::init(); $this->on(self::EVENT_BEFORE_INSERT, function ($event) { $time = TIMESTAMP; $this->create_time = $time; $this->update_time = $time; }); $this->on(self::EVENT_BEFORE_UPDATE, function ($event) { $this->update_time = TIMESTAMP; }); }