src/Sulu/Bundle/CategoryBundle/Controller/KeywordController.php
public function putAction($categoryId, $keywordId, Request $request)
    {
        $keyword = $this->getKeywordRepository()->findById($keywordId);

        if (!$keyword) {
            return $this->handleView($this->view(null, 404));
        }

        $force = $request->get('force');
        $category = $this->getCategoryRepository()->findCategoryById($categoryId);
        $keyword->setKeyword($request->get('keyword'));

        $keyword = $this->getKeywordManager()->save($keyword, $category, $force);

        $this->getEntityManager()->persist($keyword);
        $this->getEntityManager()->flush();

        return $this->handleView($this->view($keyword));
    }
public function putAction($categoryId, $keywordId, Request $request)
    {
        $keyword = $this->getKeywordRepository()->findById($keywordId);

        if (!$keyword) {
            return $this->handleView($this->view(null, 404));
        }

        $force = $request->get('force');
        $category = $this->getCategoryRepository()->findCategoryById($categoryId);
        $keyword->setKeyword($request->get('keyword'));

        $keyword = $this->getKeywordManager()->save($keyword, $category, $force);

        $this->getEntityManager()->persist($keyword);
        $this->getEntityManager()->flush();

        return $this->handleView($this->view($keyword));
    }
public function putAction ( $ categoryId , $ keywordId , Request $ request ) { $ keyword = $ this -> getKeywordRepository ( ) -> findById ( $ keywordId ) ; if ( ! $ keyword ) { return $ this -> handleView ( $ this -> view ( null , 404 ) ) ; } $ force = $ request -> get ( 'force' ) ; $ category = $ this -> getCategoryRepository ( ) -> findCategoryById ( $ categoryId ) ; $ keyword -> setKeyword ( $ request -> get ( 'keyword' ) ) ; $ keyword = $ this -> getKeywordManager ( ) -> save ( $ keyword , $ category , $ force ) ; $ this -> getEntityManager ( ) -> persist ( $ keyword ) ; $ this -> getEntityManager ( ) -> flush ( ) ; return $ this -> handleView ( $ this -> view ( $ keyword ) ) ; }
Updates given keyword for given category.

@param int $categoryId
@param int $keywordId
@param Request $request

@return Response

@throws KeywordIsMultipleReferencedException
@throws KeywordNotUniqueException
Updates given keyword for given category .