eZ\Publish\Core\SignalSlot\LocationService::copySubtree PHP Method

copySubtree() public method

Only the items on which the user has read access are copied.
public copySubtree ( eZ\Publish\API\Repository\Values\Content\Location $subtree, eZ\Publish\API\Repository\Values\Content\Location $targetParentLocation ) : eZ\Publish\API\Repository\Values\Content\Location
$subtree eZ\Publish\API\Repository\Values\Content\Location - the subtree denoted by the location to copy
$targetParentLocation eZ\Publish\API\Repository\Values\Content\Location - the target parent location for the copy operation
return eZ\Publish\API\Repository\Values\Content\Location The newly created location of the copied subtree
    public function copySubtree(Location $subtree, Location $targetParentLocation)
    {
        $returnValue = $this->service->copySubtree($subtree, $targetParentLocation);
        $this->signalDispatcher->emit(new CopySubtreeSignal(array('subtreeId' => $subtree->id, 'targetParentLocationId' => $targetParentLocation->id, 'targetNewSubtreeId' => $returnValue->id)));
        return $returnValue;
    }