eZ\Publish\Core\REST\Server\Controller\Location::copySubtree PHP Метод

copySubtree() публичный Метод

Copies a subtree to a new destination.
public copySubtree ( string $locationPath, Request $request ) : ResourceCreated
$locationPath string
$request Symfony\Component\HttpFoundation\Request
Результат eZ\Publish\Core\REST\Server\Values\ResourceCreated
    public function copySubtree($locationPath, Request $request)
    {
        $location = $this->locationService->loadLocation($this->extractLocationIdFromPath($locationPath));
        $destinationLocation = $this->locationService->loadLocation($this->extractLocationIdFromPath($this->requestParser->parseHref($request->headers->get('Destination'), 'locationPath')));
        $newLocation = $this->locationService->copySubtree($location, $destinationLocation);
        return new Values\ResourceCreated($this->router->generate('ezpublish_rest_loadLocation', array('locationPath' => trim($newLocation->pathString, '/'))));
    }