public function getRelatedContent($tagPath, Request $request)
    {
        $offset = $request->query->has('offset') ? (int) $request->query->get('offset') : 0;
        $limit = $request->query->has('limit') ? (int) $request->query->get('limit') : 25;

        $tagId = $this->extractTagIdFromPath($tagPath);
        $relatedContent = $this->tagsService->getRelatedContent(
            $this->tagsService->loadTag($tagId),
            $offset >= 0 ? $offset : 0,
            $limit >= 0 ? $limit : 25
        );

        $restContent = [];
        foreach ($relatedContent as $contentInfo) {
            $restContent[] = new BaseValues\RestContent($contentInfo);
        }

        return new Values\CachedValue(
            new Values\ContentList(
                $restContent,
                $request->getPathInfo()
            ),
            ['tagId' => $tagId]
        );
    }
public function getRelatedContent($tagPath, Request $request)
    {
        $offset = $request->query->has('offset') ? (int) $request->query->get('offset') : 0;
        $limit = $request->query->has('limit') ? (int) $request->query->get('limit') : 25;

        $tagId = $this->extractTagIdFromPath($tagPath);
        $relatedContent = $this->tagsService->getRelatedContent(
            $this->tagsService->loadTag($tagId),
            $offset >= 0 ? $offset : 0,
            $limit >= 0 ? $limit : 25
        );

        $restContent = [];
        foreach ($relatedContent as $contentInfo) {
            $restContent[] = new BaseValues\RestContent($contentInfo);
        }

        return new Values\CachedValue(
            new Values\ContentList(
                $restContent,
                $request->getPathInfo()
            ),
            ['tagId' => $tagId]
        );
    }
public function getRelatedContent ( $ tagPath , Request $ request ) { $ offset = $ request -> query -> has ( 'offset' ) ? ( int ) $ request -> query -> get ( 'offset' ) : 0 ; $ limit = $ request -> query -> has ( 'limit' ) ? ( int ) $ request -> query -> get ( 'limit' ) : 25 ; $ tagId = $ this -> extractTagIdFromPath ( $ tagPath ) ; $ relatedContent = $ this -> tagsService -> getRelatedContent ( $ this -> tagsService -> loadTag ( $ tagId ) , $ offset >= 0 ? $ offset : 0 , $ limit >= 0 ? $ limit : 25 ) ; $ restContent = [ ] ; foreach ( $ relatedContent as $ contentInfo ) { $ restContent [ ] = new BaseValues \ RestContent ( $ contentInfo ) ; } return new Values \ CachedValue ( new Values \ ContentList ( $ restContent , $ request -> getPathInfo ( ) ) , [ 'tagId' => $ tagId ] ) ; }
Returns content related to a tag.

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

@return \Netgen\TagsBundle\Core\REST\Server\Values\CachedValue
Returns content related to a tag .