public static function CartStorage::delete in Basic cart 8
Same name and namespace in other branches
- 8.6 src/CartStorage.php \Drupal\basic_cart\CartStorage::delete()
- 8.0 src/CartStorage.php \Drupal\basic_cart\CartStorage::delete()
- 8.2 src/CartStorage.php \Drupal\basic_cart\CartStorage::delete()
- 8.3 src/CartStorage.php \Drupal\basic_cart\CartStorage::delete()
- 8.4 src/CartStorage.php \Drupal\basic_cart\CartStorage::delete()
- 8.5 src/CartStorage.php \Drupal\basic_cart\CartStorage::delete()
Delete an entry from the database.
Parameters
array $entry: An array containing at least the person identifier 'pid' element of the entry to delete.
See also
File
- src/
CartStorage.php, line 90
Class
- CartStorage
- Class CartStorage.
Namespace
Drupal\basic_cartCode
public static function delete($entry) {
$delete = db_delete(self::TABLE);
if ($entry['uid']) {
$delete
->condition('uid', $entry['uid']);
}
if ($entry['id']) {
$delete
->condition('id', $entry['id']);
$delete
->condition('entitytype', $entry['entitytype'] ? $entry['entitytype'] : 'node');
}
$delete
->execute();
}