public static function del($productID) {
CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::del');
return parent::del($productID);
+ // Stop this showing up when we're looking for undeprecated del's by keeping this: static::deleteRecord(
}
}
* Delete financial Types.
*
* @param int $premiumID
+ *
+ * @deprecated
*/
public static function del($premiumID) {
- $premium = new CRM_Contribute_DAO_Premium();
- $premium->id = $premiumID;
- $premium->delete();
+ return static::deleteRecord(['id' => $premiumID]);
}
/**
* @param string $entityTable
*
* @return bool
+ *
+ * @deprecated
*/
public static function del($entityId, $entityTable) {
// delete all discount records with the selected discounted id
$discount = new CRM_Core_DAO_Discount();
$discount->entity_id = $entityId;
$discount->entity_table = $entityTable;
- if ($discount->delete()) {
- return TRUE;
+ $discount->find();
+ $ret = FALSE;
+ while ($discount->fetch()) {
+ static::deleteRecord(['id' => $discount->id]);
+ $ret = TRUE;
}
- return FALSE;
+ return $ret;
}
/**
*
* @param int $id
* @throws CRM_Core_Exception
+ *
+ * @deprecated
*/
public static function del($id) {
throw new CRM_Core_Exception('Cannot call del function');
+ // Stop this showing up when we're looking for undeprecated del's by keeping this: static::deleteRecord(
}
/**
*
* @return null
* @throws CRM_Core_Exception
+ *
+ * @deprecated
*/
public static function del($providerID) {
if (!$providerID) {
if (!$dao->find(TRUE)) {
return NULL;
}
- $dao->delete();
+ // The above just filters out attempts to delete for other domains
+ // Not sure it's needed, but preserves old behaviour and is deprecated.
+ static::deleteRecord(['id' => $providerID]);
}
/**