public function attach($owner) { parent::attach($owner); $owner->on(BaseActiveRecord::EVENT_BEFORE_INSERT, [AdminLogEvent::className(), AdminLogEvent::EVENT_CREATE_ITEM], ['title' => $this->titleAttribute, 'icon' => $this->icon]); $owner->on(BaseActiveRecord::EVENT_BEFORE_UPDATE, [AdminLogEvent::className(), AdminLogEvent::EVENT_UPDATE_ITEM], ['title' => $this->titleAttribute, 'icon' => $this->icon]); $owner->on(BaseActiveRecord::EVENT_BEFORE_DELETE, [AdminLogEvent::className(), AdminLogEvent::EVENT_DELETE_ITEM], ['title' => $this->titleAttribute, 'icon' => $this->icon]); }
public function init() { parent::init(); $this->on(AdminLogEvent::EVENT_WRONG_AUTH, [AdminLogEvent::className(), 'wrongAuth']); $this->on(AdminLogEvent::EVENT_SUCCESS_AUTH, [AdminLogEvent::className(), 'successAuth']); }
public function deleteItem($event) { AdminLogEvent::saveEvent($event, 'deleteItem'); }