You are here

function uc_product_feature_delete in Ubercart 8.4

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

Deletes a product feature object.

Parameters

$pfid: The product feature ID.

Return value

The product feature object.

2 calls to uc_product_feature_delete()
ProductFeatureDeleteForm::submitForm in uc_product/src/Form/ProductFeatureDeleteForm.php
Form submission handler.
uc_product_node_delete in uc_product/uc_product.module
Implements hook_node_delete().

File

uc_product/uc_product.module, line 949
The product module for Ubercart.

Code

function uc_product_feature_delete($pfid) {
  $feature = uc_product_feature_load($pfid);

  // Call the delete function for this product feature if it exists.
  $func = uc_product_feature_data($feature['fid'], 'delete');
  if (function_exists($func)) {
    $func($pfid);
  }
  $connection = \Drupal::database();
  $connection
    ->delete('uc_product_features')
    ->condition('pfid', $pfid)
    ->execute();
  return SAVED_DELETED;
}