Ejemplo n.º 1
0
 /**
  * Copies the content to a new location. If no version is given,
  * all versions are copied, otherwise only the given version.
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to copy the content to the given location
  *
  * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
  * @param \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct $destinationLocationCreateStruct the target location where the content is copied to
  * @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo
  *
  * @return \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;
 }