public function updateTag($tagPath, Request $request)
    {
        $tagUpdateStruct = $this->inputDispatcher->parse(
            new Message(
                ['Content-Type' => $request->headers->get('Content-Type')],
                $request->getContent()
            )
        );

        $tag = $this->tagsService->loadTag(
            $this->extractTagIdFromPath($tagPath)
        );

        $updatedTag = $this->tagsService->updateTag($tag, $tagUpdateStruct);

        $childrenCount = 0;
        $synonymsCount = 0;

        if (empty($updatedTag->mainTagId)) {
            $childrenCount = $this->tagsService->getTagChildrenCount($updatedTag);
            $synonymsCount = $this->tagsService->getTagSynonymCount($updatedTag);
        }

        return new Values\RestTag(
            $updatedTag,
            $childrenCount,
            $synonymsCount
        );
    }
public function updateTag($tagPath, Request $request)
    {
        $tagUpdateStruct = $this->inputDispatcher->parse(
            new Message(
                ['Content-Type' => $request->headers->get('Content-Type')],
                $request->getContent()
            )
        );

        $tag = $this->tagsService->loadTag(
            $this->extractTagIdFromPath($tagPath)
        );

        $updatedTag = $this->tagsService->updateTag($tag, $tagUpdateStruct);

        $childrenCount = 0;
        $synonymsCount = 0;

        if (empty($updatedTag->mainTagId)) {
            $childrenCount = $this->tagsService->getTagChildrenCount($updatedTag);
            $synonymsCount = $this->tagsService->getTagSynonymCount($updatedTag);
        }

        return new Values\RestTag(
            $updatedTag,
            $childrenCount,
            $synonymsCount
        );
    }
public function updateTag ( $ tagPath , Request $ request ) { $ tagUpdateStruct = $ this -> inputDispatcher -> parse ( new Message ( [ 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ] , $ request -> getContent ( ) ) ) ; $ tag = $ this -> tagsService -> loadTag ( $ this -> extractTagIdFromPath ( $ tagPath ) ) ; $ updatedTag = $ this -> tagsService -> updateTag ( $ tag , $ tagUpdateStruct ) ; $ childrenCount = 0 ; $ synonymsCount = 0 ; if ( empty ( $ updatedTag -> mainTagId ) ) { $ childrenCount = $ this -> tagsService -> getTagChildrenCount ( $ updatedTag ) ; $ synonymsCount = $ this -> tagsService -> getTagSynonymCount ( $ updatedTag ) ; } return new Values \ RestTag ( $ updatedTag , $ childrenCount , $ synonymsCount ) ; }
Updates a tag.

@param string $tagPath
@param \Symfony\Component\HttpFoundation\Request $request

@return \Netgen\TagsBundle\Core\REST\Server\Values\RestTag
Updates a tag .