src/Sulu/Bundle/PageBundle/Controller/NodeController.php
public function putAction(Request $request, $id)
    {
        $language = $this->getLanguage($request);
        $action = $request->get('action');

        $this->checkActionParameterSecurity($action, $language, $id);

        $document = $this->getDocumentManager()->find(
            $id,
            $language,
            [
                'load_ghost_content' => false,
                'load_shadow_content' => false,
            ]
        );

        $formType = $this->getMetadataFactory()->getMetadataForClass(get_class($document))->getFormType();

        $this->get('sulu_hash.request_hash_checker')->checkHash($request, $document, $document->getUuid());

        $this->persistDocument($request, $formType, $document, $language);
        $this->handleActionParameter($action, $document, $language);
        $this->getDocumentManager()->flush();

        $context = new Context();
        $context->setGroups(['defaultPage']);

        return $this->handleView($this->view($document)->setContext($context));
    }
public function putAction(Request $request, $id)
    {
        $language = $this->getLanguage($request);
        $action = $request->get('action');

        $this->checkActionParameterSecurity($action, $language, $id);

        $document = $this->getDocumentManager()->find(
            $id,
            $language,
            [
                'load_ghost_content' => false,
                'load_shadow_content' => false,
            ]
        );

        $formType = $this->getMetadataFactory()->getMetadataForClass(get_class($document))->getFormType();

        $this->get('sulu_hash.request_hash_checker')->checkHash($request, $document, $document->getUuid());

        $this->persistDocument($request, $formType, $document, $language);
        $this->handleActionParameter($action, $document, $language);
        $this->getDocumentManager()->flush();

        $context = new Context();
        $context->setGroups(['defaultPage']);

        return $this->handleView($this->view($document)->setContext($context));
    }
public function putAction ( Request $ request , $ id ) { $ language = $ this -> getLanguage ( $ request ) ; $ action = $ request -> get ( 'action' ) ; $ this -> checkActionParameterSecurity ( $ action , $ language , $ id ) ; $ document = $ this -> getDocumentManager ( ) -> find ( $ id , $ language , [ 'load_ghost_content' => false , 'load_shadow_content' => false , ] ) ; $ formType = $ this -> getMetadataFactory ( ) -> getMetadataForClass ( get_class ( $ document ) ) -> getFormType ( ) ; $ this -> get ( 'sulu_hash.request_hash_checker' ) -> checkHash ( $ request , $ document , $ document -> getUuid ( ) ) ; $ this -> persistDocument ( $ request , $ formType , $ document , $ language ) ; $ this -> handleActionParameter ( $ action , $ document , $ language ) ; $ this -> getDocumentManager ( ) -> flush ( ) ; $ context = new Context ( ) ; $ context -> setGroups ( [ 'defaultPage' ] ) ; return $ this -> handleView ( $ this -> view ( $ document ) -> setContext ( $ context ) ) ; }
saves node with given id and data.

@param Request $request
@param string $id

@return Response

@throws InvalidFormException
@throws InvalidHashException
@throws MissingParameterException
saves node with given id and data .