Пример #1
0
 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]);
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->on(AdminLogEvent::EVENT_WRONG_AUTH, [AdminLogEvent::className(), 'wrongAuth']);
     $this->on(AdminLogEvent::EVENT_SUCCESS_AUTH, [AdminLogEvent::className(), 'successAuth']);
 }
Пример #3
0
 public function deleteItem($event)
 {
     AdminLogEvent::saveEvent($event, 'deleteItem');
 }