CRM-13302 - webtest fix - WebTest_Contact_CustomDataAddTest
[civicrm-core.git] / CRM / Core / BAO / File.php
index c10becaced6d29a70feb4e9b1d7d89d01120776c..72ec638f925f5e7a12772716adc3ba23129d49ba 100644 (file)
    }
 
    /**
-    * 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