+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
/**
* 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;
}
/**