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

        if (trim($tag->pathString, '/') !== $tagPath) {
            throw new Exceptions\NotFoundException(
                "Could not find tag with path string ${tagPath}"
            );
        }

        $childrenCount = 0;
        $synonymsCount = 0;

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

        return new Values\CachedValue(
            new Values\RestTag(
                $tag,
                $childrenCount,
                $synonymsCount
            ),
            ['tagId' => $tag->id]
        );
    }
public function loadTag($tagPath)
    {
        $tag = $this->tagsService->loadTag(
            $this->extractTagIdFromPath($tagPath)
        );

        if (trim($tag->pathString, '/') !== $tagPath) {
            throw new Exceptions\NotFoundException(
                "Could not find tag with path string ${tagPath}"
            );
        }

        $childrenCount = 0;
        $synonymsCount = 0;

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

        return new Values\CachedValue(
            new Values\RestTag(
                $tag,
                $childrenCount,
                $synonymsCount
            ),
            ['tagId' => $tag->id]
        );
    }
public function loadTag ( $ tagPath ) { $ tag = $ this -> tagsService -> loadTag ( $ this -> extractTagIdFromPath ( $ tagPath ) ) ; if ( trim ( $ tag -> pathString , '/' ) !== $ tagPath ) { throw new Exceptions \ NotFoundException ( "Could not find tag with path string ${tagPath}" ) ; } $ childrenCount = 0 ; $ synonymsCount = 0 ; if ( empty ( $ tag -> mainTagId ) ) { $ childrenCount = $ this -> tagsService -> getTagChildrenCount ( $ tag ) ; $ synonymsCount = $ this -> tagsService -> getTagSynonymCount ( $ tag ) ; } return new Values \ CachedValue ( new Values \ RestTag ( $ tag , $ childrenCount , $ synonymsCount ) , [ 'tagId' => $ tag -> id ] ) ; }
Loads a tag object by its path.

@param string $tagPath

@throws \eZ\Publish\Core\REST\Common\Exceptions\NotFoundException If no tag is found with specified path

@return \Netgen\TagsBundle\Core\REST\Server\Values\CachedValue
Loads a tag object by its path .