/** * @param \yii\base\ModelEvent $event */ public function beforeDelete($event) { $this->beforeUpdate(); $this->setAttribute($this->deletedAttribute, ActiveRecord::STATUS_DELETED); $this->owner->save(); $event->isValid = false; }