public function EntityUsage::bulkDeleteSources in Entity Usage 8.4
Same name and namespace in other branches
- 8.2 src/EntityUsage.php \Drupal\entity_usage\EntityUsage::bulkDeleteSources()
- 8.3 src/EntityUsage.php \Drupal\entity_usage\EntityUsage::bulkDeleteSources()
Remove all records of a given source entity type.
Parameters
string $source_type: The source entity type.
Overrides EntityUsageInterface::bulkDeleteSources
File
- src/
EntityUsage.php, line 160
Class
- EntityUsage
- Defines the entity usage base class.
Namespace
Drupal\entity_usageCode
public function bulkDeleteSources($source_type) {
$query = $this->connection
->delete($this->tableName)
->condition('source_type', $source_type);
$query
->execute();
$event = new EntityUsageEvent(NULL, NULL, NULL, $source_type, NULL, NULL, NULL, NULL, NULL);
$this->eventDispatcher
->dispatch(Events::BULK_DELETE_SOURCES, $event);
}