Deletes the resource object or a list of resource objects

@param Request $request Symfony request object
@param string $resource Resource location, e.g. "product"
@param string $site Unique site code
@return Response Generated output
513982
public function deleteAction( Request $request, $resource, $site = 'default' )
	{
		$cntl = $this->createAdmin( $request, $site, $resource );

		if( ( $html = $cntl->delete() ) == '' ) {
			return $cntl->getView()->response();
		}

		return $this->getHtml( $html );
	}
50516
public function deleteApp(Request $request, ApiApplication $application)
    {
        $this->assertJsonRequestFormat($request);

        $this->getApiApplicationManipulator()->delete($application);

        return $this->app->json(['success' => true]);
    }
394649
public function destroy(Request $request, $key)
    {
        $this->getFormRequestInstance();

        $model = $this->findFirstByKey($key);

        if (!$model) {
            if ($request->wantsJson()) {
                return $this->validNotFoundJsonResponse();
            }
            abort(404);
        }

        DB::beginTransaction();

        try {
            $this->repository->delete($model);
        } catch (\Exception $e) {
            DB::rollback();

            $message = $this->destroyFailedMessage($key, $e->getMessage());
            throw new ResourceControllerException($message);
        }

        DB::commit();

        $message = $this->destroySuccessfulMessage($key);

        if ($request->wantsJson()) {
            $data = [
                $model
            ];

            return $this->validSuccessJsonResponse($message, $data);
        }

        return redirect()->route($this->getRedirectionRoute())
            ->with($this->infoFlashMessageKey, $message);
    }
1334882
public function deleteAction(Request $request, $id)
    {
        $this->checkAccess('DELETE', $id);
        $resource = $this->getResourceManager()->find($id);
        $this->getResourceManager()->remove($resource);
        $view = $this->view(null, \FOS\RestBundle\Util\Codes::HTTP_OK);
        return $this->handleView($view);
    }
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);
    }
138668
public function deleteAction(Request $request, Language $language): Response
    {
        $form = $this->formFactory->deleteLanguage(
            new LanguageDeleteData($language)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (LanguageDeleteData $data) {
                $language = $data->getLanguage();
                $this->languageService->deleteLanguage($language);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Language '%name%' removed.") */
                        'language.delete.success',
                        ['%name%' => $language->name],
                        'language'
                    )
                );
            });

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

        return $this->redirect($this->generateUrl('ezplatform.language.list'));
    }
717653
protected function _actionDelete($context)
    {
        $context->response->status = AnHttpResponse::NO_CONTENT;
        $this->getItem()->delete();
        $context->response->setRedirect(route($this->getItem()->owner->getURL()));
    }
765304
public function deleteResource(string $project, string $resource): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/resource/$resource")));
    }
262667
public function checkDeleteAction(Request $request)
    {
        $treeId = $request->get('id');
        $language = $request->get('language', 'de');

        $treeManager = $this->get('phlexible_tree.tree_manager');
        $treeMeditator = $this->get('phlexible_tree.mediator');
        $siterootManager = $this->get('phlexible_siteroot.siteroot_manager');

        $nodeId = $treeId[0];
        $tree = $treeManager->getByNodeId($nodeId);
        $node = $tree->get($nodeId);

        $instances = $treeManager->getInstanceNodes($node);

        if (count($instances) > 1) {
            $instancesArray = [];
            foreach ($instances as $instanceNode) {
                $siteroot = $siterootManager->find($instanceNode->getTree()->getSiterootId());
                $instanceTitle = $treeMeditator->getField($instanceNode, 'backend', $language);

                $instancesArray[] = [
                    $instanceNode->getId(),
                    $siteroot->getTitle(),
                    $instanceTitle,
                    $instanceNode->getCreatedAt()->format('Y-m-d H:i:s'),
                    (bool) $instanceNode->getTree()->isInstanceMaster($instanceNode),
                    (bool) ($instanceNode->getId() === $nodeId),
                ];
            }

            return new ResultResponse(true, '', $instancesArray);
        }

        return new ResultResponse(true, '', []);
    }
800972
public function remove(Request $request)
    {
        $app = $this->app;

        $store = $this->getStore();

        if (method_exists($this, 'beforeRemove')) {
            $response = $this->beforeRemove($request);

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

        $ids = $request->get('ids', array());

        if (count($ids) == 0) {
            $ids[] = $request->get('id');
        }

        $success = true;

        foreach ($ids as $idx => $id) {
            if (!$store->remove($id)) {
                $success = false;
            }
        }

        $response = [
            'success' => $success
        ];

        if (method_exists($this, 'afterRemove')) {
            $response = $this->afterRemove($request, $response);

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

        return $app->json($response);
    }
1258403
public function deleteAction(Request $request, $id)
    {
        $manager = $this->get('opifer.content.content_manager');
        $content = $manager->getRepository()->find($id);

        $em = $this->get('doctrine')->getManager();
        $em->remove($content);
        $em->flush();

        return new JsonResponse(['success' => true]);
    }
75399
public static base_response delete(nitro_service client, String sitename) throws Exception {
		gslbsite deleteresource = new gslbsite();
		deleteresource.sitename = sitename;
		return deleteresource.delete_resource(client);
	}
811919
public function destroy(Request $request, $id)
    {
        return $this->library->delete($id, $request->all());
    }
1356037
public function deleteAction(Request $request, $id)
    {
        try {
            $mediaManager = $this->get('opifer.media.media_manager');
            $media = $mediaManager->getRepository()->find($id);

            $dispatcher = $this->get('event_dispatcher');
            $event = new MediaResponseEvent($media, $request);
            $dispatcher->dispatch(OpiferMediaEvents::MEDIA_CONTROLLER_DELETE, $event);

            if (null !== $event->getResponse()) {
                return $event->getResponse();
            }

            $mediaManager->remove($media);
        } catch (\Exception $e) {
            return new JsonResponse(['success' => false, 'message' => $e->getMessage()]);
        }

        return new JsonResponse(['success' => true]);
    }
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;
    }
646290
public function userDeleteAction(Request $request): Response
    {
        $form = $this->formFactory->deleteUser();

        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (UserDeleteData $data) {
                $contentInfo = $data->getContentInfo();

                $location = $this->locationService->loadLocation($contentInfo->mainLocationId);

                $user = $this->userService->loadUser($contentInfo->id);

                $this->userService->deleteUser($user);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("User with login '%login%' deleted.") */
                        'user.delete.success',
                        ['%login%' => $user->login],
                        'content'
                    )
                );

                return new RedirectResponse($this->generateUrl('_ezpublishLocation', [
                    'locationId' => $location->parentLocationId,
                ]));
            });

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

        return $this->redirect($this->generateUrl('ezplatform.dashboard'));
    }
1352502
public function destroy(Request $request)
    {
        $count = 0;

        // Carregar IDs
        $ids = $this->getId($request);
        $ids = explode(',', $ids);
        foreach ($ids as $id) {
            $count += $this->deleteModel($id) ? 1 : 0;
        }

        return response()->json((object)['success' => ($count > 0), 'count' => $count]);
    }