Remove the container.

@param Request $request

@return Response
541144
public function removeAction(Request $request)
    {
        $container = $this->findContainerByRequest($request);
        $content = $container->getContent();

        try {
            $this->getEditor()->getContainerManager()->delete($container);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        // Stores id for front removal
        $removedId = $this->getViewBuilder()->buildContainer($container)->getAttributes()->getId();

        $this->validate($content);
        $this->persist($content);

        $data = [
            'removed' => [$removedId],
            //'contents' => [$this->getViewBuilder()->buildContent($content)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
1341016
public function removeTrailingSlashAction(Request $request)
    {
        $pathInfo   = $request->getPathInfo();
        $requestUri = $request->getRequestUri();
        
        $url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
        
        return $this->redirect($url, 301);
    }
65931
public function deleteAction(Request $request)
    {
        $id = $request->get('id');

        $elementtypeService = $this->get('phlexible_elementtype.elementtype_service');
        $elementtype = $elementtypeService->findElementtype($id);

        $elementtypeService->deleteElementtype($elementtype);

        return new ResultResponse(true, "Element type $id soft deleted.");
    }
616405
public function destroy($request) {
        $this->resolveModel();
        $model = Dir::apiModel($this->model);

        if(!empty($request->relationalModel)) {
            $modelRelational = trim(strtolower($request->relationalModel), 's');
            $item = $model::where([
                $model::EQUALS(
                    $modelRelational.'Id',
                    $request->idRelational
                ),
                $model::EQUALS(
                    'id',
                    $request->id
                )
            ]);

            if(sizeof($item) != 1)
                killer('400');
        }

        $model::destroy($request->id);
    }
804408
public function trashContainerAction(Request $request): Response
    {
        $form = $this->formFactory->trashContainerLocation(
            new LocationTrashContainerData()
        );

        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (LocationTrashContainerData $data) {
                return $this->handleTrashLocationForm($data);
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        if (empty($form->getData()->getLocation())) {
            throw new BadRequestHttpException();
        }

        // in case of error when processing form ($result === null) redirect to the same Location
        return $this->redirectToLocation($form->getData()->getLocation());
    }
203991
public function deleteAction(Request $request)
    {
        $fileId = $request->get('file_id');
        $fileIds = explode(',', $fileId);

        $volumeManager = $this->get('phlexible_media_manager.volume_manager');

        foreach ($fileIds as $fileId) {
            try {
                $volume = $volumeManager->getByFileId($fileId);
                $file = $volume->findFile($fileId);
                $volume->deleteFile($file, $this->getUser()->getId());
            } catch (NotFoundException $e) {
            }
        }

        return new ResultResponse(true, count($fileIds).' file(s) deleted.');
    }
109632
public function createContainerAction(Request $request)
    {
        $content = $this->findContentByRequest($request);
        $type = $request->request->get('type', null);

        try {
            $container = $this->getEditor()->createDefaultContainer($type, [], $content);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($content);
        $this->persist($content);

        $viewBuilder = $this->getViewBuilder();

        $data = [
            'created' => $viewBuilder->buildContainer($container)->getAttributes()->getId(),
            'content' => $viewBuilder->buildContent($content),
        ];

        return $this->buildResponse($data, self::SERIALIZE_FULL);
    }
465664
public function downAction(Request $request)
    {
        /** @var MenuRepository $repo */
        $repo = $this->get('vince_cms.repository.menu');
        /** @var Menu $menu */
        $menu = $repo->find($request->get('id'));
        if ($menu->getParent()) {
            $repo->moveDown($menu);
        }

        return $this->redirect($this->generateUrl('admin_my_cms_menu_list'));
    }
1013528
public function deleteAction(Request $request)
    {
        if ($this->submitForm($this->buildForm(CsrfProtectionType::class), $request)->isValid()) {
            try {
                $this->getDomainManager()->delete($this->find('delete'));
            } catch (DomainException $e) {
                $this->processException($e);
            }
        }

        return $this->processAction('delete');
    }
168448
public function untrashAction(Request $request)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getAdmin();

        $admin->checkAccess('undelete');

        /** @var \Sonata\DoctrineORMAdminBundle\Model\ModelManager $modelManager */
        $modelManager = $admin->getModelManager();

        /** @var EntityManager $em */
        $em = $modelManager->getEntityManager($admin->getClass());

        $filters = $em->getFilters();

        if ($admin->getParent()) {
            $filters->enable('softdeleteable');
            $filters->enable('softdeleteabletrash');

            /** @var SoftDeleteableFilter $softdeleteable */
            $softdeleteable = $filters->getFilter('softdeleteable');

            /** @var SoftDeleteableTrashFilter $softdeleteabletrash */
            $softdeleteabletrash = $filters->getFilter('softdeleteabletrash');

            $parentEntityClass = $admin->getParent()->getClass();

            $softdeleteable->enableForEntity($parentEntityClass);
            $softdeleteabletrash->disableForEntity($parentEntityClass);

            $softdeleteable->disableForEntity($admin->getClass());
        } elseif ($filters->isEnabled('softdeleteable')) {
            $filters->disable('softdeleteable');
            $filters->enable('softdeleteabletrash');
        }

        $id = $request->get($admin->getIdParameter());
        $object = $admin->getObject($id);

        if (!$object) {
            throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
        }

        if ('POST' === $request->getMethod()) {
            // check the csrf token
            $this->validateCsrfToken('sonata.untrash');

            $translator = $this->get('translator');

            try {
                $object->setDeletedAt(null);
                $admin->update($object);

                if ($this->isXmlHttpRequest()) {
                    return $this->renderJson(['result' => 'ok']);
                }

                $this->addFlash('sonata_flash_info', $translator->trans('flash_untrash_successfull', []));
            } catch (\Exception $e) {
                if ($this->isXmlHttpRequest()) {
                    return $this->renderJson(['result' => 'error']);
                }

                $this->addFlash('sonata_flash_info', $translator->trans('flash_untrash_error', []));
            }

            return new RedirectResponse($admin->generateUrl('list'));
        }

        return $this->renderWithExtraParams('@CompoSonataAdmin/CRUD/untrash.html.twig', [
            'object' => $object,
            'action' => 'untrash',
            'csrf_token' => $this->getCsrfToken('sonata.untrash'),
        ]);
    }
722072
public function destroy(Banner $banner, Request $request)
    {
        // update list order
        $banner->update(['list_order' => 999]);

        $this->deleteEntry($banner, $request);

        return redirect_to_resource();
    }
1358886
public function destroy(Request $request, $clientId)
    {
        $client = $this->clients->findForUser($clientId, $request->user()->getKey());

        if (! $client) {
            return new Response('', 404);
        }

        $this->clients->delete($client);

        return new Response('', Response::HTTP_NO_CONTENT);
    }
156334
public function logout (Request $request)
    {
        $request->getSession ()->set ('catlab-user-id', null);
        $request->getSession ()->set ('catlab-non-verified-user-id', null);
        return $this->postLogout ($request);
    }
150943
public function delete(Request $request)
    {
        $isOk = "OK";
        // loop throw file array
        foreach ($request->all() as $key => $file){
            if ($key === "postTypes") {
                continue;
            }

            // check if user has permissions to access this link
            if(!User::hasAccess('Media', 'delete', $file['mediaID'], true)) {
                return $this->noPermission();
            }

            // get file info from database
            $media = Media::find($file['mediaID']);
            MediaRelation::where("mediaID", $file['mediaID'])->delete();
            if ($media->delete()) { // delete from database
                if(file_exists($media->url)) {
                    unlink($media->url); // delete original file
                }
                $media->deleteThumbs();
            }else{
                $isOk =  "ERR";
            }
        }
        return $isOk;
    }
342422
public function cdeleteAction(Request $request)
    {
        $ids = array_filter(explode(',', $request->get('ids', '')));

        $documentManager = $this->getDocumentManager();
        foreach ($ids as $id) {
            $document = $documentManager->find($id);
            $documentManager->remove($document);
            $documentManager->flush();
        }

        return $this->handleView($this->view(null));
    }
1058787
public function removeAction(Request $request): Response
    {
        $form = $this->formFactory->removeBookmark(
            new BookmarkRemoveData()
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (BookmarkRemoveData $data) {
                foreach ($data->getBookmarks() as $locationId => $selected) {
                    $this->bookmarkService->deleteBookmark(
                        $this->locationService->loadLocation($locationId)
                    );
                }

                return $this->redirectToRoute('ezplatform.bookmark.list');
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirectToRoute('ezplatform.bookmark.list');
    }
1297548
public function remove($id, Request $request)
    {
        $entity = $this->getEntityById($id);

        if (!$entity) {
            return $this->response(null, Response::HTTP_NOT_FOUND);
        }

        $result = $this->manager->remove($entity);

        if (!$result->ok()) {
            return $this->response(['errors' => $result->getSimpleErrors()], Response::HTTP_BAD_REQUEST);
        }

        return $this->response(null, Response::HTTP_NO_CONTENT);
    }