function FileUsageInterface::delete

Same name in other branches
  1. 9 core/modules/file/src/FileUsage/FileUsageInterface.php \Drupal\file\FileUsage\FileUsageInterface::delete()
  2. 8.9.x core/modules/file/src/FileUsage/FileUsageInterface.php \Drupal\file\FileUsage\FileUsageInterface::delete()
  3. 11.x core/modules/file/src/FileUsage/FileUsageInterface.php \Drupal\file\FileUsage\FileUsageInterface::delete()

Removes a record to indicate that a module is no longer using a file.

Parameters

\Drupal\file\FileInterface $file: A file entity.

string $module: The name of the module using the file.

string $type: (optional) The type of the object that contains the referenced file. May be omitted if all module references to a file are being deleted. Defaults to NULL.

string $id: (optional) The unique ID of the object containing the referenced file. May be omitted if all module references to a file are being deleted. Defaults to NULL.

int $count: (optional) The number of references to delete from the object. Defaults to 1. Zero may be specified to delete all references to the file within a specific object.

1 method overrides FileUsageInterface::delete()
FileUsageBase::delete in core/modules/file/src/FileUsage/FileUsageBase.php
Removes a record to indicate that a module is no longer using a file.

File

core/modules/file/src/FileUsage/FileUsageInterface.php, line 55

Class

FileUsageInterface
File usage backend interface.

Namespace

Drupal\file\FileUsage

Code

public function delete(FileInterface $file, $module, $type = NULL, $id = NULL, $count = 1);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.