public function copyContent($contentId, Request $request)
    {
        $destination = $request->headers->get('Destination');

        $parentLocationParts = explode('/', $destination);
        $copiedContent = $this->repository->getContentService()->copyContent(
            $this->repository->getContentService()->loadContentInfo($contentId),
            $this->repository->getLocationService()->newLocationCreateStruct(array_pop($parentLocationParts))
        );

        return new Values\ResourceCreated(
            $this->router->generate(
                'ezpublish_rest_loadContent',
                array('contentId' => $copiedContent->id)
            )
        );
    }
public function copyContent($contentId, Request $request)
    {
        $destination = $request->headers->get('Destination');

        $parentLocationParts = explode('/', $destination);
        $copiedContent = $this->repository->getContentService()->copyContent(
            $this->repository->getContentService()->loadContentInfo($contentId),
            $this->repository->getLocationService()->newLocationCreateStruct(array_pop($parentLocationParts))
        );

        return new Values\ResourceCreated(
            $this->router->generate(
                'ezpublish_rest_loadContent',
                array('contentId' => $copiedContent->id)
            )
        );
    }
public function copyContent ( $ contentId , Request $ request ) { $ destination = $ request -> headers -> get ( 'Destination' ) ; $ parentLocationParts = explode ( '/' , $ destination ) ; $ copiedContent = $ this -> repository -> getContentService ( ) -> copyContent ( $ this -> repository -> getContentService ( ) -> loadContentInfo ( $ contentId ) , $ this -> repository -> getLocationService ( ) -> newLocationCreateStruct ( array_pop ( $ parentLocationParts ) ) ) ; return new Values \ ResourceCreated ( $ this -> router -> generate ( 'ezpublish_rest_loadContent' , array ( 'contentId' => $ copiedContent -> id ) ) ) ; }
Creates a new content object as copy under the given parent location given in the destination header.

@param mixed $contentId

@return \eZ\Publish\Core\REST\Server\Values\ResourceCreated
Creates a new content object as copy under the given parent location given in the destination header .