eZ\Publish\Core\REST\Server\Controller\Location::swapLocation PHP Method

swapLocation() public method

Swaps a location with another one.
public swapLocation ( string $locationPath, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent
$locationPath string
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\NoContent
    public function swapLocation($locationPath, Request $request)
    {
        $locationId = $this->extractLocationIdFromPath($locationPath);
        $location = $this->locationService->loadLocation($locationId);
        $destinationLocation = $this->locationService->loadLocation($this->extractLocationIdFromPath($this->requestParser->parseHref($request->headers->get('Destination'), 'locationPath')));
        $this->locationService->swapLocation($location, $destinationLocation);
        return new Values\NoContent();
    }