Deletes a resource by UUID

@param string $uuid UUID of the resource
@return \Dingo\Api\Http\Response
@throws NotFoundHttpException
519250
public function delete($uuid)
    {
        $model = static::$model::findOrFail($uuid);

        $this->authorizeUserAction('delete', $model);

        $deletedCount = $model->delete();

        if ($deletedCount < 1) {
            throw new NotFoundHttpException('Could not find a resource with that UUID to delete');
        }

        return $this->response->noContent()->setStatusCode(204);
    }
407421
public function getAction($uuid, Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $document = $this->getDocumentManager()->find(
            $uuid,
            $locale
        );

        return $this->handleView(
            $this->view($document)->setSerializationContext(
                SerializationContext::create()
                    ->setSerializeNull(true)
                    ->setGroups(['defaultPage', 'defaultArticle', 'smallArticlePage'])
            )
        );
    }
786244
@Override
	public void removeByUuid(String uuid) {
		for (CPDAvailabilityEstimate cpdAvailabilityEstimate : findByUuid(
				uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpdAvailabilityEstimate);
		}
	}
1237083
@Override
	public void removeByUuid(String uuid) {
		for (CommerceCountry commerceCountry : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceCountry);
		}
	}
195530
public function postTriggerAction($uuid, Request $request)
    {
        // extract parameter
        $action = $this->getRequestParameter($request, 'action', true);
        $locale = $this->getRequestParameter($request, 'locale', true);

        // prepare vars
        $view = null;
        $data = null;
        $userId = $this->getUser()->getId();

        try {
            switch ($action) {
                case 'unpublish':
                    $document = $this->getDocumentManager()->find($uuid, $locale);
                    $this->getDocumentManager()->unpublish($document, $locale);
                    $this->getDocumentManager()->flush();

                    $data = $this->getDocumentManager()->find($uuid, $locale);

                    break;
                case 'remove-draft':
                    $data = $this->getDocumentManager()->find($uuid, $locale);
                    $this->getDocumentManager()->removeDraft($data, $locale);
                    $this->getDocumentManager()->flush();

                    break;
                case 'copy-locale':
                    $destLocales = $this->getRequestParameter($request, 'dest', true);
                    $destLocales = explode(',', $destLocales);

                    $securityChecker = $this->get('sulu_security.security_checker');
                    foreach ($destLocales as $destLocale) {
                        $securityChecker->checkPermission(
                            new SecurityCondition($this->getSecurityContext(), $destLocale),
                            PermissionTypes::EDIT
                        );
                    }

                    $this->getMapper()->copyLanguage($uuid, $userId, null, $locale, $destLocales);

                    $data = $this->getDocumentManager()->find($uuid, $locale);

                    break;
                case 'copy':
                    /** @var ArticleDocument $document */
                    $document = $this->getDocumentManager()->find($uuid, $locale);
                    $copiedPath = $this->getDocumentManager()->copy($document, dirname($document->getPath()));
                    $this->getDocumentManager()->flush();

                    $data = $this->getDocumentManager()->find($copiedPath, $locale);

                    break;
                case 'order':
                    $this->orderPages($this->getRequestParameter($request, 'pages', true), $locale);
                    $this->getDocumentManager()->flush();
                    $this->getDocumentManager()->clear();

                    $data = $this->getDocumentManager()->find($uuid, $locale);

                    break;
                default:
                    throw new RestException('Unrecognized action: ' . $action);
            }

            // prepare view
            $view = $this->view($data);
            $view->setSerializationContext(
                SerializationContext::create()
                    ->setSerializeNull(true)
                    ->setGroups(['defaultPage', 'defaultArticle', 'smallArticlePage'])
            );
        } catch (RestException $exc) {
            $view = $this->view($exc->toArray(), 400);
        }

        return $this->handleView($view);
    }
999870
public function show($uuid)
    {
        $response = $this->httpClient->get($this->getResourceUrl($uuid));

        return ContainerResponse::createFromHttpResponse($response);
    }
185021
private function resolvePathByUuid($uuid)
    {
        $queryBuilder = new QueryBuilder($this->qomFactory);

        $queryBuilder
            ->select('node', 'jcr:uuid', 'uuid')
            ->from($this->qomFactory->selector('node', 'nt:unstructured'))
            ->where(
                $this->qomFactory->comparison(
                    $this->qomFactory->propertyValue('node', 'jcr:uuid'),
                    '=',
                    $this->qomFactory->literal($uuid)
                )
            );

        $rows = $queryBuilder->execute();

        if (1 !== count(iterator_to_array($rows->getRows()))) {
            throw new ItemNotFoundException();
        }

        return $rows->getRows()->current()->getPath();
    }
1088814
public function getSelection($uuid)
    {
        foreach ($this->selections as $selection) {
            if ($selection->getUuid() === $uuid) {
                return $selection;
            }
        }
    }
1212360
public static function getByUuid(string $uuid): ?WebhookEvent
    {
        $event = WebhookEvent::get("/webhook-events/:uuid", [ "uuid" => $uuid ])->first();

        /** @var WebhookEvent $event */
        return $event;
    }
841626
@Override
	public void removeByUuid(String uuid) {
		for (CPOptionCategory cpOptionCategory : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpOptionCategory);
		}
	}
439404
public function delete($publicationUuid, $data)
    {
        $url = $this->url.'/'.$publicationUuid;
        $response = $this->restClient->delete($url, $this->options);
        $this->checkError($response, 'DELETE', $url);
    }
921064
public function deleteAction($id)
    {
        $delete = function($id) {
            $group = $this->getDoctrine()
                ->getRepository(static::$entityName)
                ->findGroupById($id);

            if (!$group) {
                throw new EntityNotFoundException(static::$entityName, $id);
            }

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

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

        return $this->handleView($view);
    }
545042
public function deleteUrls(
        $uuid,
        $token = null
    ) {
        $headers = [];

        if (!empty($token)) {
            $headers['Authorization'] = $token;
        }

        $response = $this->client->delete($uuid, [
            'headers' => $headers,
        ]);

        $this->log->debug("Gemini DELETE response", [
            'uuid' => $uuid,
            'response' => $response,
        ]);

        return true;
    }
213552
public function deleteIndex(IndexUUID $indexUUID)
    {
        if (!array_key_exists($this->getIndexKey($indexUUID), $this->indices)) {
            throw ResourceNotAvailableException::indexNotAvailable('Index not available in InMemoryRepository');
        }

        unset($this->indices[$this->getIndexKey($indexUUID)]);
    }
943581
public function delete(string $id)
    {
        $url = $this->url.'/'.$id;

        return $this->curl->delete($url);
    }
726473
public function destroy($id)
    {
        $deletedUser = $this->repository
            ->query()
            ->withTrashed()
            ->whereId($id)->first();

        $deletedUser->forceDelete();
        
        return redirect()->route('admin.user-delete-request.index');
    }
19577
public function getItem($uuid)
    {
        $found = null;
        foreach ($this->items as $item) {
            if ($item->getUuid() === $uuid) {
                $found = $item;
                break;
            }
        }

        return $found;
    }