/**
* Delete all the files and associated object associated with this
* combination
+ * @return bool
+ * Was file deleted?
*/
public static function deleteEntityFile($entityTable, $entityID, $fileTypeID = NULL, $fileID = NULL) {
+ $isDeleted = FALSE;
if (empty($entityTable) || empty($entityID)) {
- return;
+ return $isDeleted;
}
$config = CRM_Core_Config::singleton();
$cefIDs = implode(',', $cefIDs);
$sql = "DELETE FROM civicrm_entity_file where id IN ( $cefIDs )";
CRM_Core_DAO::executeQuery($sql);
+ $isDeleted = TRUE;
}
if (!empty($cfIDs)) {
$sql = "DELETE FROM civicrm_file where id IN ( $deleteFiles )";
CRM_Core_DAO::executeQuery($sql);
}
+ $isDeleted = TRUE;
}
+ return $isDeleted;
}
/**