src/Services/BaseFileService.php
protected function handleDELETE()
    {
        $force = $this->request->getParameterAsBool('force', false);
        $noCheck = $this->request->getParameterAsBool('no_check', false);
        $contentOnly = $this->request->getParameterAsBool('content_only', false);

        if (empty($this->folderPath)) {
            // delete just folders and files from the container
            if (!empty($content = ResourcesWrapper::unwrapResources($this->request->getPayloadData()))) {
                $result = $this->deleteFolderContent($content, '', $force);
            } else {
                throw new BadRequestException('No resources given for delete.');
            }
        } else {
            if (empty($this->filePath)) {
                // delete directory of files and the directory itself
                // multi-file or folder delete via post data
                if (!empty($content = ResourcesWrapper::unwrapResources($this->request->getPayloadData()))) {
                    $result = $this->deleteFolderContent($content, $this->folderPath, $force);
                } else {
                    $this->driver->deleteFolder($this->container, $this->folderPath, $force, $contentOnly);
                    $result = ['name' => basename($this->folderPath), 'path' => $this->folderPath];
                }
            } else {
                // delete file from permanent storage
                $this->driver->deleteFile($this->container, $this->filePath, $noCheck);
                $result = ['name' => basename($this->filePath), 'path' => $this->filePath];
            }
        }

        return ResponseFactory::create(ResourcesWrapper::cleanResources($result));
    }
protected function handleDELETE()
    {
        $force = $this->request->getParameterAsBool('force', false);
        $noCheck = $this->request->getParameterAsBool('no_check', false);
        $contentOnly = $this->request->getParameterAsBool('content_only', false);

        if (empty($this->folderPath)) {
            // delete just folders and files from the container
            if (!empty($content = ResourcesWrapper::unwrapResources($this->request->getPayloadData()))) {
                $result = $this->deleteFolderContent($content, '', $force);
            } else {
                throw new BadRequestException('No resources given for delete.');
            }
        } else {
            if (empty($this->filePath)) {
                // delete directory of files and the directory itself
                // multi-file or folder delete via post data
                if (!empty($content = ResourcesWrapper::unwrapResources($this->request->getPayloadData()))) {
                    $result = $this->deleteFolderContent($content, $this->folderPath, $force);
                } else {
                    $this->driver->deleteFolder($this->container, $this->folderPath, $force, $contentOnly);
                    $result = ['name' => basename($this->folderPath), 'path' => $this->folderPath];
                }
            } else {
                // delete file from permanent storage
                $this->driver->deleteFile($this->container, $this->filePath, $noCheck);
                $result = ['name' => basename($this->filePath), 'path' => $this->filePath];
            }
        }

        return ResponseFactory::create(ResourcesWrapper::cleanResources($result));
    }
protected function handleDELETE ( ) { $ force = $ this -> request -> getParameterAsBool ( 'force' , false ) ; $ noCheck = $ this -> request -> getParameterAsBool ( 'no_check' , false ) ; $ contentOnly = $ this -> request -> getParameterAsBool ( 'content_only' , false ) ; if ( empty ( $ this -> folderPath ) ) { // delete just folders and files from the container if ( ! empty ( $ content = ResourcesWrapper :: unwrapResources ( $ this -> request -> getPayloadData ( ) ) ) ) { $ result = $ this -> deleteFolderContent ( $ content , '' , $ force ) ; } else { throw new BadRequestException ( 'No resources given for delete.' ) ; } } else { if ( empty ( $ this -> filePath ) ) { // delete directory of files and the directory itself // multi-file or folder delete via post data if ( ! empty ( $ content = ResourcesWrapper :: unwrapResources ( $ this -> request -> getPayloadData ( ) ) ) ) { $ result = $ this -> deleteFolderContent ( $ content , $ this -> folderPath , $ force ) ; } else { $ this -> driver -> deleteFolder ( $ this -> container , $ this -> folderPath , $ force , $ contentOnly ) ; $ result = [ 'name' => basename ( $ this -> folderPath ) , 'path' => $ this -> folderPath ] ; } } else { // delete file from permanent storage $ this -> driver -> deleteFile ( $ this -> container , $ this -> filePath , $ noCheck ) ; $ result = [ 'name' => basename ( $ this -> filePath ) , 'path' => $ this -> filePath ] ; } } return ResponseFactory :: create ( ResourcesWrapper :: cleanResources ( $ result ) ) ; }
Handles DELETE actions.

@return \DreamFactory\Core\Utility\ServiceResponse
@throws BadRequestException
Handles DELETE actions .