*
* @return int
* Group ID (null if Group ID doesn't exist)
+ * @throws CRM_Core_Exception
*/
private static function _getGid() {
if (!self::$_gid) {
self::$_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'pdf_format', 'id', 'name');
if (!self::$_gid) {
- CRM_Core_Error::fatal(ts('PDF Format Option Group not found in database.'));
+ throw new CRM_Core_Exception(ts('PDF Format Option Group not found in database.'));
}
}
return self::$_gid;
* @param array $values associative array of name/value pairs
* @param int $id
* Id of the database record (null = new record).
+ * @throws CRM_Core_Exception
*/
public function savePdfFormat(&$values, $id = NULL) {
// get the Option Group ID for PDF Page Formats (create one if it doesn't exist)
// make sure serialized array will fit in the 'value' column
$attribute = CRM_Core_DAO::getAttribute('CRM_Core_BAO_PdfFormat', 'value');
if (strlen($this->value) > $attribute['maxlength']) {
- CRM_Core_Error::fatal(ts('PDF Page Format does not fit in database.'));
+ throw new CRM_Core_Exception(ts('PDF Page Format does not fit in database.'));
}
$this->save();
*
* @param int $id
* ID of the PDF Page Format to be deleted.
- *
+ * @throws CRM_Core_Exception
*/
public static function del($id) {
if ($id) {
}
}
}
- CRM_Core_Error::fatal(ts('Invalid value passed to delete function.'));
+ throw new CRM_Core_Exception(ts('Invalid value passed to delete function.'));
}
}