}
/**
- * The $useWhere is used so that the signature matches the parent class
+ * A static function wrapper that deletes the various objects that are
+ * connected to a file object (i.e. file, entityFile and customValue
*/
- public function delete($useWhere = false) {
- list($fileID, $entityID, $fieldID) = func_get_args();
-
+ public static function deleteFileReferences($fileID, $entityID, $fieldID) {
$fileDAO = new CRM_Core_DAO_File();
$fileDAO->id = $fileID;
if (!$fileDAO->find(TRUE)) {
CRM_Core_DAO::executeQuery($query, $params);
}
+ /**
+ * The $useWhere is used so that the signature matches the parent class
+ */
+ public function delete($useWhere = false) {
+ list($fileID, $entityID, $fieldID) = func_get_args();
+
+ self::deleteFileReferences($fileID, $entityID, $fieldID);
+ }
+
/**
* delete all the files and associated object associated with this
* combination