Deleting a file

@param string $id
@param string $type - mms|voice
@return object
@option bool "success"
189448
public function delete($id, $type) {
		$params = array(
			'id' => $id,
			'type' => $type
		);
		return $this->master->call('files/delete', $params);
	}
543810
public static function delete($id, $options = [])
    {
        $url = static::classUrl() . '/' . $id;
        return static::_directRequest('delete', $url, null, $options);
    }
1215430
public function removeDocuments(array $ids, $index, $type = '')
    {
        if (empty($type)) {
            $type = $this->typeName;
        }

        $client = $this->getClient();
        $index = $client->getIndex($index);

        $client->deleteIds($ids, $index, $type);

        // Refresh index because bulk deletions are slow
        $index->refresh();
    }
1274003
public function deleteBreakType($id)
    {
        list($response, $statusCode, $httpHeader) = $this->deleteBreakTypeWithHttpInfo ($id);
        return $response; 
    }
63752
public function delete($id)
    {
        $files = glob($this->getFilename($id));

        if (count($files)) {
            array_map('unlink', $files);
        }
    }
230543
protected function deleteFilesAndImages($id)
    {
        $data = $this->model->with($this->getRelations())
            ->findOrFail($id)->toArray();

        $this->builder->fields()->filter(function ($field) {
            return $field instanceof Field\File;
        })->each(function (File $file) use ($data) {
            $file->setOriginal($data);

            $file->destroy();
        });
    }
878107
public function loadFile($type, $id) {
    $query = $this->connection->select('file_usage', 'n');
    $query->fields('n', array('fid'));
    $query->condition('n.module', 'site_commerce');
    $query->condition('n.type', $type);
    $query->condition('n.id', $id);
    $fid = $query->execute()->fetchField();
    $file = null;
    if ($fid) {
      $file = File::load($fid);
    }
    return $file;
  }
1260474
public function delete($id)
	{
		try {
			$this->getClient()->get(array(
				'index' => $this->name,
				'type'  => static::$default_type,
				'id'    => $id,
			));
		} catch (\Elasticsearch\Common\Exceptions\Missing404Exception $e) {
			return false;
		}
		
		$doc = $this->getClient()->delete(array(
			'index' => $this->name,
			'type'  => static::$default_type,
			'id'    => $id,
		));
		
		return true;
	}
226200
public function uninstall($id, $type)
    {
        $installer = $this->getInstaller();

        return $installer->uninstall($type, $id);
    }
1275622
public function destroy($id)
    {
        $files = $this->repository->find($id);

        if (empty($files)) {
            Cms::notification('File not found', 'warning');

            return redirect(route($this->routeBase.'.files.index'));
        }

        if (is_file(storage_path($files->location))) {
            Storage::delete($files->location);
        } else {
            Storage::disk(config('cms.storage-location', 'local'))->delete($files->location);
        }

        $files->delete();

        Cms::notification('File deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.files.index'));
    }
1176423
public function delete($id) {
        $this->checkPermissions('delete');
        
        return $this->client->deleteData($this->resourceName . '/' . $id);
    }
1058505
public function deleteAction($id)
    {
        /** @var ContentManager $manager */
        $manager = $this->get('opifer.content.content_manager');
        $content = $manager->getRepository()->find($id);

        //generate new slug so deleted slug can be used again
        $hashedSlug = $content->getSlug().'-'.sha1(date('Y-m-d H:i:s'));

        $content->setSlug($hashedSlug);
        $manager->save($content);

        $manager->remove($content);

        return new JsonResponse(['success' => true]);
    }
969491
public function delete($id)
    {
        $this->createChunksIndex();

        $this->chunks->remove(['files_id' => $id], ['justOne' => false]);
        return parent::remove(['_id' => $id]);
    }
904837
public function delete($id)
    {
        $model = $this->findRecord($id);

        if ($model) {
            return $model->delete();
        }

        return false;

    }
1032404
public function destroy($id)
    {
        try {
            $file = $this->fileDB->getById($id);
            $this->fileDB->deleteFile($file);
            return 'File deleted';
        } catch (\Exception $e) {
            \Log::error($e);
            $this->flashMessage('delete-failed','danger');
            return 'Error: File not deleted';
        }
    }
1253272
public function destroy($id)
    {
        $file = $this->fileRepo->getById($id);

        if (!empty($file)) {
            $this->authorize('delete', $file);
            $this->fileRepo->delete($file);
            return $this->respondWithSimpleSuccess(['success' => true]);
        }
        return $this->respondNotFound();
    }
1222968
public function deleteAction($id)
    {
        $response = parent::deleteAction($id);
        $this->fileManager->remove($id);
        return $response;
    }