*/
public static function exportFinancialBatch($batchIds, $exportFormat, $downloadFile) {
if (empty($batchIds)) {
- CRM_Core_Error::fatal(ts('No batches were selected.'));
- return;
+ throw new CRM_Core_Exception(ts('No batches were selected.'));
}
if (empty($exportFormat)) {
- CRM_Core_Error::fatal(ts('No export format selected.'));
- return;
+ throw new CRM_Core_Exception(ts('No export format selected.'));
}
self::$_exportFormat = $exportFormat;
$exporter = new $exporterClass();
}
else {
- CRM_Core_Error::fatal("Could not locate exporter: $exporterClass");
+ throw new CRM_Core_Exception("Could not locate exporter: $exporterClass");
}
$export = [];
$exporter->_isDownloadFile = $downloadFile;
return TRUE;
}
else {
- CRM_Core_Error::fatal(ts('Petition Id and/or Activity Id is not of the type Positive.'));
- return FALSE;
+ throw new CRM_Core_Exception(ts('Petition Id and/or Activity Id is not of the type Positive.'));
}
}
$petitionInfo = [];
CRM_Campaign_BAO_Survey::retrieve($petitionParams, $petitionInfo);
if (empty($petitionInfo)) {
- CRM_Core_Error::fatal('Petition doesn\'t exist.');
+ throw new CRM_Core_Exception('Petition doesn\'t exist.');
}
//get the default domain email address.
$result['ssl'] = $caConfig->toStreamOptions();
}
if (!$caConfig->isEnableSSL() && preg_match('/^https:/', $url)) {
- CRM_Core_Error::fatal('Cannot fetch document - system does not support SSL');
+ throw new CRM_Core_Exception('Cannot fetch document - system does not support SSL');
}
return $result;
$ppTypeDAO = new CRM_Financial_DAO_PaymentProcessorType();
$ppTypeDAO->id = $params['payment_processor_type_id'];
if (!$ppTypeDAO->find(TRUE)) {
- CRM_Core_Error::fatal(ts('Could not find payment processor meta information'));
+ throw new CRM_Core_Exception(ts('Could not find payment processor meta information'));
}
// also copy meta fields from the info DAO
*/
public static function del($paymentProcessorID) {
if (!$paymentProcessorID) {
- CRM_Core_Error::fatal(ts('Invalid value passed to delete function.'));
+ throw new CRM_Core_Exception(ts('Invalid value passed to delete function.'));
}
$dao = new CRM_Financial_DAO_PaymentProcessor();
$ppByName = self::getAllPaymentProcessorTypes('name');
if (array_key_exists($paymentProcessorType->name, $ppByName)) {
if ($ppByName[$paymentProcessorType->name] != $paymentProcessorType->id) {
- CRM_Core_Error::fatal('This payment processor type already exists.');
+ throw new CRM_Core_Exception('This payment processor type already exists.');
}
}
}
*/
public static function getMembershipCount($membershipTypeId, $date = NULL, $isTest = 0, $isOwner = 0) {
if (!CRM_Utils_Rule::date($date)) {
- CRM_Core_Error::fatal(ts('Invalid date "%1" (must have form yyyy-mm-dd).', [1 => $date]));
+ throw new CRM_Core_Exception(ts('Invalid date "%1" (must have form yyyy-mm-dd).', [1 => $date]));
}
$params = [
list($ch, $caConfig) = $this->createCurl($remoteFile);
if (preg_match('/^https:/', $remoteFile) && !$caConfig->isEnableSSL()) {
- // CRM_Core_Error::fatal('Cannot install this extension - does not support SSL');
return [self::STATUS_DL_ERROR, NULL];
}
public function post($remoteFile, $params) {
// Download extension zip file ...
if (!function_exists('curl_init')) {
- //CRM_Core_Error::fatal('Cannot install this extension - curl is not installed!');
return [self::STATUS_DL_ERROR, NULL];
}
list($ch, $caConfig) = $this->createCurl($remoteFile);
if (preg_match('/^https:/', $remoteFile) && !$caConfig->isEnableSSL()) {
- // CRM_Core_Error::fatal('Cannot install this extension - does not support SSL');
return [self::STATUS_DL_ERROR, NULL];
}