public function init() { parent::init(); $this->on(ActiveRecord::EVENT_BEFORE_INSERT, [$this, 'attachImageEvent']); $this->on(ActiveRecord::EVENT_BEFORE_INSERT, [$this, 'updateDefaultsEvent']); $this->on(ActiveRecord::EVENT_BEFORE_UPDATE, [$this, 'updateDefaultsEvent']); $this->on(ActiveRecord::EVENT_AFTER_INSERT, [$this, 'updateDefaultsPostEvent']); $this->on(ActiveRecord::EVENT_AFTER_UPDATE, [$this, 'updateDefaultsPostEvent']); $this->on(ActiveRecord::EVENT_BEFORE_DELETE, [$this, 'detachImageEvent']); }
public function init() { parent::init(); $this->on(ActiveRecord::EVENT_BEFORE_INSERT, [$this, 'attachEvent']); $this->on(ActiveRecord::EVENT_BEFORE_DELETE, [$this, 'detachEvent']); }