Handle the deleted event for the model.

@param RatingModelContract $rating
773214
public function deleted(RatingModelContract $rating)
    {
        event(new ModelWasUnRated($rating->rateable, $rating->user_id));
        app(RatingServiceContract::class)->updateRating($rating->rateable, -($rating->rating));
    }
487160
public function deleteModel(): bool
    {
        $this->getFromForm();
        $this->is_deleted = true;
        if (!$this->save()) {
            throw new \Exception(\Yii::t('app', 'Ошибка при удалении кода'));
        }
        return true;
    }
892548
protected function deleteModels(): void
    {
        $model = app($this->modelClass);
        // determine if the model uses `SoftDeletes` trait
        $usesSoftDeletes = in_array(SoftDeletes::class, class_uses($model));

        foreach ($model->all() as $value) {
            try {
                if ($usesSoftDeletes) {
                    $value->forceDelete();
                } else {
                    $value->delete();
                }
            } catch (Exception $exception) {
                Log::warning(sprintf('Error during deleting models. Table: %s. Error: %s', $model->getTable(), $exception->getMessage()));
            }
        }
    }
474740
public function DeleteReview()
    {
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_ACTION_ID)) {
            $this->DeleteReviewFromActionId();
        } elseif ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) {
            $this->DeleteReviewFromOwner();
        } else {
            $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-MISSING-PARAMETER');
        }
        $this->RedirectToItemPage();
    }
1222693
public function deleteAction()
    {
        $request = $this->getRequest();

        $model = $this->getModel();
        $model->applyRequest($request);

        if ($model->getFilter()) {
            $model->delete();
        } else {
            $this->addMessage($this->_('Empty delete request not allowed'));
        }
        $this->_reroute(array($request->getActionKey() => 'index', MUTil_Model::REQUEST_ID => null));
    }
359988
public function afterDelete(Model $Model) {
		if ($this->settings[$Model->alias]['auto'] === false) {
			return;
		}
		if (!$Model->ShadowModel) {
			return;
		}
		if (isset($this->deleteUpdates[$Model->alias]) && !empty($this->deleteUpdates[$Model->alias])) {
			foreach ($this->deleteUpdates[$Model->alias] as $assocAlias => $assocIds) {
				$Model->{$assocAlias}->updateRevisions($assocIds);
			}
			unset($this->deleteUpdates[$Model->alias]);
		}
	}
906504
public function onAfterDelete()
    {
        // Prepare blank manipulation
        $manipulations = new AssetManipulationList();

        // Add all assets for deletion
        $this->addAssetsFromRecord($manipulations, $this->owner, AssetManipulationList::STATE_DELETED);

        // Whitelist assets that exist in other stages
        $this->addAssetsFromOtherStages($manipulations);

        // Apply visibility rules based on the final manipulation
        $this->processManipulation($manipulations);
    }
616427
public function handleDeleteOrganizer(AbstractDeleteOrganizer $deleteOrganizer)
    {
        $offer = $this->load($deleteOrganizer->getItemId());

        $offer->deleteOrganizer(
            $deleteOrganizer->getOrganizerId()
        );

        $this->offerRepository->save($offer);
    }
481478
public function deleted($model)
    {
        $translationRepository = \App::make(TranslationRepository::class);
        foreach ($model->translatableAttributes() as $attribute) {
            $translationRepository->deleteByCode($model->translationCodeFor($attribute));
        }
    }
904993
protected void revalidateSelection(int rating) {
        for (MaterialIcon icon : iconList) {
            icon.removeStyleName(AddinsCssName.MATERIAL_RATING_UNSELECTED);
            icon.removeStyleName(AddinsCssName.MATERIAL_RATING_SELECTED);
        }

        for (int i = 0; i < rating && i < iconList.size(); i++) {
            MaterialIcon icon = iconList.get(i);
            icon.setIconType(selectedRatingIcon);
            icon.addStyleName(AddinsCssName.MATERIAL_RATING_SELECTED);
        }

        for (int i = rating; i < iconList.size(); i++) {
            MaterialIcon icon = iconList.get(i);
            icon.setIconType(unselectedRatingIcon);
            icon.addStyleName(AddinsCssName.MATERIAL_RATING_UNSELECTED);
        }
    }
1061138
public function handle(JobDeleted $event)
    {
        $this->jobs->completed($event->payload, $event->job->hasFailed());

        if (! $event->job->hasFailed() && count($this->tags->monitored($event->payload->tags())) > 0) {
            $this->jobs->remember($event->connectionName, $event->queue, $event->payload);
        }
    }
907206
public function handleDelete(int $id): void
	{
		if ($this->isAjax() && $this->editConst) {
			$content = $this->orm->content->getById($id);
			$this->orm->content->removeAndFlush($content);
			$this['list']->reload();
		} else {
			$this->terminate();
		}
	}
213699
public function rateAction(Order $order, $rating)
    {
        $order->rate($rating);

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
1186126
public function delete()
    {
        if ($this->isNewRecord()) {
            throw new DeleteModelException("New models can't be deleted.");
        }

        $this->beforeDelete();
        $this->raiseEvent("BeforeDelete");

        $this->Deleted = true;
        $this->save();

        $this->afterDelete();
        $this->raiseEvent("AfterDelete");
    }
754136
public function deleted(LikeContract $like)
    {
        if ($like->type_id == LikeType::LIKE) {
            event(new ModelWasUnliked($like->likeable, $like->user_id));
            app(LikeableServiceContract::class)->decrementLikesCount($like->likeable);
        } else {
            event(new ModelWasUndisliked($like->likeable, $like->user_id));
            app(LikeableServiceContract::class)->decrementDislikesCount($like->likeable);
        }
    }
1013305
protected function performDeleteOnModel()
    {
        $results = $this->makeRequest($this->getEndpoint(), 'destroy', [
            $this->getKey()
        ]);

        // Creation failed
        if (!$results) {
            return false;
        }

        return true;
    }
691738
public function deleting($model)
    {
        if ($model->accountableEnabled() &&
            collect(class_uses($model))->contains(SoftDeletes::class)) {
            $model->{$this->config['column_names']['deleted_by']} = $this->accountableUserId();

            $model->save();
        }
    }