public function cloneInstance()
    {
        if(!$this->isXmlHttpRequest()){
            throw new common_exception_BadRequest('wrong request mode');
        }

        $uri = $this->getRequestParameter('uri');

        $this->signatureValidator->checkSignature(
            $this->getRequestParameter('signature'),
            $uri
        );

        $this->validateInstanceRoot($uri);

        $clone = $this->getClassService()->cloneInstance($this->getCurrentInstance(), $this->getCurrentClass());
        if(!is_null($clone)){
            $this->returnJson(array(
                'label' => $clone->getLabel(),
                'uri'   => tao_helpers_Uri::encode($clone->getUri())
            ));
        }
    }
public function cloneInstance()
    {
        if(!$this->isXmlHttpRequest()){
            throw new common_exception_BadRequest('wrong request mode');
        }

        $uri = $this->getRequestParameter('uri');

        $this->signatureValidator->checkSignature(
            $this->getRequestParameter('signature'),
            $uri
        );

        $this->validateInstanceRoot($uri);

        $clone = $this->getClassService()->cloneInstance($this->getCurrentInstance(), $this->getCurrentClass());
        if(!is_null($clone)){
            $this->returnJson(array(
                'label' => $clone->getLabel(),
                'uri'   => tao_helpers_Uri::encode($clone->getUri())
            ));
        }
    }
public function cloneInstance ( ) { if ( ! $ this -> isXmlHttpRequest ( ) ) { throw new common_exception_BadRequest ( 'wrong request mode' ) ; } $ uri = $ this -> getRequestParameter ( 'uri' ) ; $ this -> signatureValidator -> checkSignature ( $ this -> getRequestParameter ( 'signature' ) , $ uri ) ; $ this -> validateInstanceRoot ( $ uri ) ; $ clone = $ this -> getClassService ( ) -> cloneInstance ( $ this -> getCurrentInstance ( ) , $ this -> getCurrentClass ( ) ) ; if ( ! is_null ( $ clone ) ) { $ this -> returnJson ( array ( 'label' => $ clone -> getLabel ( ) , 'uri' => tao_helpers_Uri :: encode ( $ clone -> getUri ( ) ) ) ) ; } }
Duplicate the current instance
render a JSON response

@throws \League\Flysystem\FileExistsException
@throws common_Exception
@throws common_exception_BadRequest
@throws common_exception_Error
@throws tao_models_classes_MissingRequestParameterException

@return void
@requiresRight uri READ
@requiresRight classUri WRITE
Duplicate the current instance render a JSON response