*/
public function __construct() {
parent::__construct(TRUE);
- $this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
+ }
+
+ public function getGroupId() {
+ return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
self::CUSTOM_SEARCH_GROUP_NAME, 'id', 'name'
);
}
}
$weight = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue',
- ['option_group_id' => $this->groupId]
+ ['option_group_id' => $this->getGroupId()]
);
$params = [
- 'option_group_id' => $this->groupId,
+ 'option_group_id' => $this->getGroupId(),
'weight' => $weight,
'description' => $info->label . ' (' . $info->key . ')',
'name' => $info->key,
public function onPreUninstall(CRM_Extension_Info $info) {
$customSearchesByName = $this->getCustomSearchesByName();
if (!array_key_exists($info->key, $customSearchesByName)) {
- CRM_Core_Error::fatal('This custom search is not registered.');
+ throw new CRM_Core_Exception('This custom search is not registered.');
}
$cs = $this->getCustomSearchesById();
$id = $cs[$customSearchesByName[$info->key]];
- $optionValue = CRM_Core_BAO_OptionValue::del($id);
+ CRM_Core_BAO_OptionValue::del($id);
return TRUE;
}