@param $id

@return \Symfony\Component\HttpFoundation\RedirectResponse

@throws NotFoundHttpException

@Route("/{id}/delete", requirements={"id" = "\d+"}, name="KunstmaanTranslatorBundle_settings_translations_delete", methods={"GET", "POST"})
436367
public function deleteAction(Request $request, $id)
    {
        /* @var $em EntityManager */
        $em = $this->getDoctrine()->getManager();

        $indexUrl = $this->getAdminListConfigurator()->getIndexUrl();
        if ($request->isMethod('POST')) {
            $em->getRepository('KunstmaanTranslatorBundle:Translation')->removeTranslations($id);
        }

        return new RedirectResponse($this->generateUrl($indexUrl['path'], isset($indexUrl['params']) ? $indexUrl['params'] : []));
    }
806405
public function actionDelete($id)
    {
        if (Yii::$app->request->isPost) {
            $this->findModel($id)->delete();
        }
        return $this->redirect(['index']);
    }
610495
public function deleteAction($id)
    {
        $delete = function($id) {
            $role = $this->getRoleRepository()->findRoleById($id);

            if (!$role) {
                throw new EntityNotFoundException($this->getRoleRepository()->getClassName(), $id);
            }

            $em = $this->getDoctrine()->getManager();
            $em->remove($role);
            $em->flush();
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
904556
public function deleteAction($id)
    {
        $subscriptionManager = $this->get('phlexible_message.subscription_manager');

        $subscription = $subscriptionManager->find($id);
        $subscriptionManager->deleteSubscription($subscription);

        return new ResultResponse(true, 'Subscription deleted.');
    }
1271644
public function actionDelete($id)
    {
        $this->findModel($id)->delete();
        Yii::$app->getSession()->setFlash('success', Yii::t('system', 'Delete success.'));
        return $this->redirect(['index']);
    }
381506
public function actionDeleteVideo($id)
    {
        $model = $this->module->manager->findVideoGalleryItemById($id);
        if ($model === null) {
            throw new NotFoundHttpException('The requested page does not exist');
        }

        $model->delete();

        \Yii::$app->getSession()->setFlash('video_gallery.success', \Yii::t('video_gallery', 'Video has been deleted'));

        return $this->redirect(['videos', 'id' => $model->video_gallery_id]);
    }
440827
public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrineManager();
            $entity = $em->getRepository('BisonLabSakonninBundle:MessageType')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find MessageType entity.');
            }

            $em->remove($entity);
            $em->flush();
        }
        return $this->redirectToRoute('messagetype');
    }
1285191
public function getDelete($id = null)
    {
        // Get comment information
        $comment = Comments::getCommentsRepository()->find($id);

        if ($comment == null)
        {
            // Prepare the error message
            $error = Lang::get('comments.comment.not_found');

            // Redirect to the post management page
            return Redirect::route('posts')->with('error', $error);
        }

        Base::Log('Comment (' . $comment->id . ') was deleted.');

        // Delete the post
        $comment->delete();

        // Prepare the success message
        $success = Lang::get('comments.comment.deleted');

        // Redirect to the post management page
        return Redirect::back()->with('success', $success);
    }
226340
public function delete($id)
    {
        try {
            $this->roleRepositoryInterface->delete($id);
        } catch (RolesException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('roles.index');
        }

        Flash::success(trans('dashboard::dashboard.flash.role.delete.success'));

        return redirect()->route('roles.index');
    }
77964
public function deleteAction($id)
    {
        $contentType = $this->contentTypeManager->getContentTypeById($id);

        if ($contentType === null) {
            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->configurationManager->getEntityClass('content_type'),
                [$id]
            );
        }

        $this->om->remove($contentType);
        $this->om->flush();

        return $this->redirectToRoute('sherlockode_acb_content_type_list');
    }
1060175
public function deleteAction($id)
    {
        $response = $this->getResponse();
        $this->model->deleteRecord($id);
        $response->setStatusCode(Response::HTTP_NO_CONTENT);

        return $response;
    }
770125
public function deleteAction($id)
    {
        $manager = $this->get('opifer.redirect.redirect_manager');

        $redirect = $manager->getRepository()->find($id);

        $manager->remove($redirect);
        $this->addFlash('success', $this->get('translator')->trans('opifer_redirect.flash.deleted'));

        return $this->redirectToRoute('opifer_redirect_redirect_index');
    }
509041
public function deleteAction($id)
    {
        $content = $this->contentManager->getContentById($id);

        if ($content === null) {
            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->configurationManager->getEntityClass('content'),
                [$id]
            );
        }

        $this->om->remove($content);
        $this->om->flush();

        return $this->redirectToRoute('sherlockode_acb_content_list');
    }
641668
public function actionSave($id = null, $languageId)
    {
        if (!empty($languageId)) {
            if (!empty($id)) {

                $model = $this->findModel($id);
                if (empty($model)) {
                    throw new NotFoundHttpException;
                }
                $modelTranslation = $this->findModelTranslation($id, $languageId);
                if (empty($modelTranslation)) {
                    $modelTranslation = new DeliveryMethodTranslation();
                }
            }
            else {
                $model = new DeliveryMethod();
                $modelTranslation = new DeliveryMethodTranslation();
            }
        }
        else throw new BadRequestHttpException();


        if ($model->load(Yii::$app->request->post()) && $modelTranslation->load(Yii::$app->request->post())) {

            $model->logo = UploadedFile::getInstance($model, 'logo');
            if (!empty($model->logo)) {

                $uploadedImageName = $model->upload();

                $model->image_name = $uploadedImageName;
            }
            $model->save(false);

            $modelTranslation->delivery_method_id = $model->id;
            $modelTranslation->language_id = $languageId;
            if ($modelTranslation->validate()) {

                $modelTranslation->save();
                return $this->redirect(['save', 'id' => $model->id, 'languageId' => $languageId]);
            }
        }
        return $this->render('save', [
            'model' => $model,
            'modelTranslation' => $modelTranslation,
            'languages' => Language::find()->all(),
            'selectedLanguage' => Language::findOne($languageId)
        ]);

    }
452334
public function delete($id) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Position not found.']);
		}

		// delete
		$this->dispatch(PositionEvent::PRE_DELETE, $model);
		$model->delete();

		if ($model->isDeleted()) {
			$this->dispatch(PositionEvent::POST_DELETE, $model);
			return new Deleted(['model' => $model]);
		}

		return new NotDeleted(['message' => 'Could not delete Position']);
	}
24707
public function actionDelete($id)
    {
        if (($model = PaymentMethod::findOne($id)) !== null) {
            $model->delete();
            return $this->redirect(['index']);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
683341
public function actionDeleteProduct($id)
    {
        if (($model = OrderProduct::findOne($id)) !== null) {
            $model->delete();
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $this->redirect(\Yii::$app->request->referrer);
    }