You are here

function uc_file_empty in Ubercart 8.4

Same name and namespace in other branches
  1. 6.2 uc_file/uc_file.module \uc_file_empty()
  2. 7.3 uc_file/uc_file.module \uc_file_empty()

Removes all downloadable files, as well as their associations.

1 call to uc_file_empty()
FeatureSettingsForm::submitForm in uc_file/src/Form/FeatureSettingsForm.php
Form submission handler.

File

uc_file/uc_file.module, line 371
Allows products to be associated with downloadable files.

Code

function uc_file_empty() {
  $connection = \Drupal::database();
  $files = $connection
    ->query('SELECT * FROM {uc_files}');
  foreach ($files as $file) {
    _uc_file_prune_db($file->fid);
  }
}