public function delete($id)
    {
        $file = $this->collectionWrapper->findFileById($id);
        $this->collectionWrapper->deleteFileAndChunksById($id);

        if ($file === null) {
            throw FileNotFoundException::byId($id, $this->getFilesNamespace());
        }
    }
public function delete($id)
    {
        $file = $this->collectionWrapper->findFileById($id);
        $this->collectionWrapper->deleteFileAndChunksById($id);

        if ($file === null) {
            throw FileNotFoundException::byId($id, $this->getFilesNamespace());
        }
    }
public function delete ( $ id ) { $ file = $ this -> collectionWrapper -> findFileById ( $ id ) ; $ this -> collectionWrapper -> deleteFileAndChunksById ( $ id ) ; if ( $ file === null ) { throw FileNotFoundException :: byId ( $ id , $ this -> getFilesNamespace ( ) ) ; } }
Delete a file from the GridFS bucket.

If the files collection document is not found, this method will still
attempt to delete orphaned chunks.

@param mixed $id File ID
@throws FileNotFoundException if no file could be selected
@throws DriverRuntimeException for other driver errors (e.g. connection errors)
Delete a file from the GridFS bucket .