You are here

public function AssetFileStorage::deleteFiles in Asset Injector 8.2

Same name and namespace in other branches
  1. 8 src/AssetFileStorage.php \Drupal\asset_injector\AssetFileStorage::deleteFiles()

Delete files for an asset.

Yes, we can have multiple files for an asset configuration, if we have overrides.

File

src/AssetFileStorage.php, line 70

Class

AssetFileStorage
Class AssetFileStorage.

Namespace

Drupal\asset_injector

Code

public function deleteFiles() {
  $pattern = $this
    ->internalFileUri(TRUE);
  $paths = glob($pattern);
  foreach ($paths as $path) {
    self::getFileSystemService()
      ->delete($path);
  }
}