public function afterDelete() { // Try delete the underlying object (Post, Question, Task, ...) $this->resetPolymorphicRelation(); if ($this->getPolymorphicRelation() !== null) { $this->getPolymorphicRelation()->delete(); } parent::afterDelete(); }
/** * @inheritdoc */ public function afterDelete() { if ($this->content !== null) { $this->content->delete(); } parent::afterDelete(); }
/** * @inheritdoc */ public function afterDelete() { ContentContainer::deleteAll(['pk' => $this->getPrimaryKey(), 'class' => $this->className()]); parent::afterDelete(); }
/** * @inheritdoc */ public function afterDelete() { $content = Content::findOne(['object_id' => $this->id, 'object_model' => $this->className()]); if ($content !== null) { $content->delete(); } parent::afterDelete(); }