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

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

        // Csrf token validation
        $this->validateCsrf();
        $this->validateInstanceRoot($id);

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

        $resource = $this->getResource($this->getRequestParameter('id'));
        $deleted = $this->getClassService()->deleteResource($resource);
        return $this->returnJson(array(
            'deleted' => $deleted
        ));
    }
public function deleteResource()
    {
        if (!$this->isXmlHttpRequest() || !$this->hasRequestParameter('id')) {
            throw new common_exception_BadRequest('wrong request mode');
        }

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

        // Csrf token validation
        $this->validateCsrf();
        $this->validateInstanceRoot($id);

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

        $resource = $this->getResource($this->getRequestParameter('id'));
        $deleted = $this->getClassService()->deleteResource($resource);
        return $this->returnJson(array(
            'deleted' => $deleted
        ));
    }
public function deleteResource ( ) { if ( ! $ this -> isXmlHttpRequest ( ) || ! $ this -> hasRequestParameter ( 'id' ) ) { throw new common_exception_BadRequest ( 'wrong request mode' ) ; } $ id = $ this -> getRequestParameter ( 'id' ) ; // Csrf token validation $ this -> validateCsrf ( ) ; $ this -> validateInstanceRoot ( $ id ) ; $ this -> signatureValidator -> checkSignature ( $ this -> getRequestParameter ( 'signature' ) , $ id ) ; $ resource = $ this -> getResource ( $ this -> getRequestParameter ( 'id' ) ) ; $ deleted = $ this -> getClassService ( ) -> deleteResource ( $ resource ) ; return $ this -> returnJson ( array ( 'deleted' => $ deleted ) ) ; }
Generic resource deletion action

@throws Exception
@throws common_exception_BadRequest
@requiresRight id WRITE
Generic resource deletion action