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

        $destinationHref = $request->headers->get('Destination');

        try {
            $parsedDestinationHref = $this->requestParser->parseHref(
                $destinationHref,
                'tagPath'
            );
        } catch (Exceptions\InvalidArgumentException $e) {
            throw new BadRequestException("{$destinationHref} is not an acceptable destination");
        }

        $targetTag = $this->tagsService->loadTag(
            $this->extractTagIdFromPath(
                $parsedDestinationHref
            )
        );

        $this->tagsService->mergeTags($tag, $targetTag);

        return new BaseValues\NoContent();
    }
public function mergeTags($tagPath, Request $request)
    {
        $tag = $this->tagsService->loadTag(
            $this->extractTagIdFromPath($tagPath)
        );

        $destinationHref = $request->headers->get('Destination');

        try {
            $parsedDestinationHref = $this->requestParser->parseHref(
                $destinationHref,
                'tagPath'
            );
        } catch (Exceptions\InvalidArgumentException $e) {
            throw new BadRequestException("{$destinationHref} is not an acceptable destination");
        }

        $targetTag = $this->tagsService->loadTag(
            $this->extractTagIdFromPath(
                $parsedDestinationHref
            )
        );

        $this->tagsService->mergeTags($tag, $targetTag);

        return new BaseValues\NoContent();
    }
public function mergeTags ( $ tagPath , Request $ request ) { $ tag = $ this -> tagsService -> loadTag ( $ this -> extractTagIdFromPath ( $ tagPath ) ) ; $ destinationHref = $ request -> headers -> get ( 'Destination' ) ; try { $ parsedDestinationHref = $ this -> requestParser -> parseHref ( $ destinationHref , 'tagPath' ) ; } catch ( Exceptions \ InvalidArgumentException $ e ) { throw new BadRequestException ( "{$destinationHref} is not an acceptable destination" ) ; } $ targetTag = $ this -> tagsService -> loadTag ( $ this -> extractTagIdFromPath ( $ parsedDestinationHref ) ) ; $ this -> tagsService -> mergeTags ( $ tag , $ targetTag ) ; return new BaseValues \ NoContent ( ) ; }
Merges two tags.

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

@throws \eZ\Publish\Core\REST\Server\Exceptions\BadRequestException if the Destination header cannot be parsed as a tag

@return \eZ\Publish\Core\REST\Server\Values\NoContent
Merges two tags .