public function deleteAction(Request $request, $id)
    {
        $locale = $this->getLocale($request);
        $webspaceKey = $request->query->get('webspace', null);

        $references = $this->snippetRepository->getReferences($id);

        if (count($references) > 0) {
            $force = $request->headers->get('SuluForceRemove', false);
            if ($force) {
                $this->contentMapper->delete($id, $webspaceKey, true);
            } else {
                return $this->getReferentialIntegrityResponse($webspaceKey, $references, $id, $locale);
            }
        } else {
            $this->contentMapper->delete($id, $webspaceKey);
        }

        return new JsonResponse();
    }