function uc_option_image_uninstall in Ubercart Option Images 7
Same name and namespace in other branches
- 6 uc_option_image.install \uc_option_image_uninstall()
File
- ./
uc_option_image.install, line 79 - Provides install and uninstall hooks.
Code
function uc_option_image_uninstall() {
// remove any images we're associated with
$result = db_select("file_usage", 'fu')
->fields('fu', array(
'fid',
))
->condition('module', 'uc_option_image')
->execute();
foreach ($result as $row) {
$file = file_load($row->fid);
if (!$file) {
continue;
}
file_usage_delete($file, 'uc_option_image');
file_delete($file);
}
}