src/Sulu/Bundle/SnippetBundle/Controller/SnippetController.php
public function putAction(Request $request, $id)
    {
        $document = $this->findDocument($id, $this->getLocale($request));

        $this->requestHashChecker->checkHash($request, $document, $document->getUuid());
        if (!$this->checkAreaSnippet($request, $document)) {
            return new JsonResponse(
                [
                    'structures' => [],
                    'other' => [],
                    'isDefault' => true,
                ],
                409
            );
        }

        $this->processForm($request, $document);

        return $this->handleView($document);
    }
public function putAction(Request $request, $id)
    {
        $document = $this->findDocument($id, $this->getLocale($request));

        $this->requestHashChecker->checkHash($request, $document, $document->getUuid());
        if (!$this->checkAreaSnippet($request, $document)) {
            return new JsonResponse(
                [
                    'structures' => [],
                    'other' => [],
                    'isDefault' => true,
                ],
                409
            );
        }

        $this->processForm($request, $document);

        return $this->handleView($document);
    }
public function putAction ( Request $ request , $ id ) { $ document = $ this -> findDocument ( $ id , $ this -> getLocale ( $ request ) ) ; $ this -> requestHashChecker -> checkHash ( $ request , $ document , $ document -> getUuid ( ) ) ; if ( ! $ this -> checkAreaSnippet ( $ request , $ document ) ) { return new JsonResponse ( [ 'structures' => [ ] , 'other' => [ ] , 'isDefault' => true , ] , 409 ) ; } $ this -> processForm ( $ request , $ document ) ; return $ this -> handleView ( $ document ) ; }
Saves a new existing snippet.

@param Request $request
@param string $id

@return \Symfony\Component\HttpFoundation\Response
Saves a new existing snippet .