eZ\Publish\Core\SignalSlot\ContentService::copyContent PHP Метод

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

Copies the content to a new location. If no version is given, all versions are copied, otherwise only the given version.
public copyContent ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\Content\LocationCreateStruct $destinationLocationCreateStruct, eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo = null ) : eZ\Publish\API\Repository\Values\Content\Content
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$destinationLocationCreateStruct eZ\Publish\API\Repository\Values\Content\LocationCreateStruct the target location where the content is copied to
$versionInfo eZ\Publish\API\Repository\Values\Content\VersionInfo
Результат eZ\Publish\API\Repository\Values\Content\Content
    public function copyContent(ContentInfo $contentInfo, LocationCreateStruct $destinationLocationCreateStruct, VersionInfo $versionInfo = null)
    {
        $returnValue = $this->service->copyContent($contentInfo, $destinationLocationCreateStruct, $versionInfo);
        $this->signalDispatcher->emit(new CopyContentSignal(array('srcContentId' => $contentInfo->id, 'srcVersionNo' => $versionInfo !== null ? $versionInfo->versionNo : null, 'dstContentId' => $returnValue->getVersionInfo()->getContentInfo()->id, 'dstVersionNo' => $returnValue->getVersionInfo()->versionNo, 'dstParentLocationId' => $destinationLocationCreateStruct->parentLocationId)));
        return $returnValue;
    }