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

        try {
            $createdTag = $this->tagsService->createTag($synonymCreateStruct);
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedTag(new Values\RestTag($createdTag, 0, 0));
    }
public function createTag(Request $request)
    {
        $synonymCreateStruct = $this->inputDispatcher->parse(
            new Message(
                ['Content-Type' => $request->headers->get('Content-Type')],
                $request->getContent()
            )
        );

        try {
            $createdTag = $this->tagsService->createTag($synonymCreateStruct);
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedTag(new Values\RestTag($createdTag, 0, 0));
    }
public function createTag ( Request $ request ) { $ synonymCreateStruct = $ this -> inputDispatcher -> parse ( new Message ( [ 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ] , $ request -> getContent ( ) ) ) ; try { $ createdTag = $ this -> tagsService -> createTag ( $ synonymCreateStruct ) ; } catch ( InvalidArgumentException $ e ) { throw new ForbiddenException ( $ e -> getMessage ( ) ) ; } return new Values \ CreatedTag ( new Values \ RestTag ( $ createdTag , 0 , 0 ) ) ; }
Creates a new tag.

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

@throws \eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException If there was an error while creating the tag

@return \Netgen\TagsBundle\Core\REST\Server\Values\CreatedTag
Creates a new tag .