*/
class CRM_Core_BAO_File extends CRM_Core_DAO_File {
- static $_signableFields = ['entityTable', 'entityID', 'fileID'];
+ public static $_signableFields = ['entityTable', 'entityID', 'fileID'];
/**
* Takes an associative array and creates a File object.
return [NULL, NULL];
}
-
/**
* @param $data
* @param int $fileTypeID
$fileDAO = new CRM_Core_DAO_File();
$fileDAO->id = $fileID;
if (!$fileDAO->find(TRUE)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception(ts('File not found'));
}
// lets call a pre hook before the delete, so attachments hooks can get the info before things
$entityFileDAO->entity_table = $tableName;
if (!$entityFileDAO->find(TRUE)) {
- CRM_Core_Error::fatal(sprintf('No record found for given file ID - %d and entity ID - %d', $fileID, $entityID));
+ throw new CRM_Core_Exception(sprintf('No record found for given file ID - %d and entity ID - %d', $fileID, $entityID));
}
$entityFileDAO->delete();
self::deleteEntityFile($params['entityTable'], $params['entityID'], NULL, $params['fileID']);
}
-
/**
* Display paper icon for a file attachment -- CRM-13624
*
*
* @param int $entityId entity id the file is attached to
* @param int $fileId file ID
+ * @param int $genTs
+ * @param int $life
* @return string
*/
public static function generateFileHash($entityId = NULL, $fileId = NULL, $genTs = NULL, $life = NULL) {