* $Id: $
*
*/
-
abstract class CRM_Utils_Hook {
// Allowed values for dashboard hook content placement
*
* @return mixed
*/
- abstract function invoke(
+ public abstract function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix
*
* @return array|bool
*/
- function commonInvoke(
+ public function commonInvoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix, $fnPrefix
*
* @return array|bool
*/
- function runHooks(
+ public function runHooks(
$civiModules, $fnSuffix, $numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6
) {
}
if (!empty($fResult) &&
- is_array($fResult)) {
+ is_array($fResult)
+ ) {
$result = array_merge($result, $fResult);
}
}
$event = new \Civi\Core\Event\PreEvent($op, $objectName, $id, $params);
\Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_pre", $event);
\Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_pre::$objectName", $event);
- return self::singleton()->invoke(4, $op, $objectName, $id, $params, self::$_nullObject, self::$_nullObject, 'civicrm_pre');
+ return self::singleton()
+ ->invoke(4, $op, $objectName, $id, $params, self::$_nullObject, self::$_nullObject, 'civicrm_pre');
}
/**
$event = new \Civi\Core\Event\PostEvent($op, $objectName, $objectId, $objectRef);
\Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_post", $event);
\Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_post::$objectName", $event);
- return self::singleton()->invoke(4, $op, $objectName, $objectId, $objectRef, self::$_nullObject, self::$_nullObject, 'civicrm_post');
+ return self::singleton()
+ ->invoke(4, $op, $objectName, $objectId, $objectRef, self::$_nullObject, self::$_nullObject, 'civicrm_post');
}
/**
* @return null the return value is ignored
*/
public static function preProcess($formName, &$form) {
- return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess');
+ return self::singleton()
+ ->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess');
}
/**
* @return null the return value is ignored
*/
public static function buildForm($formName, &$form) {
- return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildForm');
+ return self::singleton()->invoke(2, $formName, $form,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_buildForm'
+ );
}
/**
* @return null the return value is ignored
*/
public static function postProcess($formName, &$form) {
- return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_postProcess');
+ return self::singleton()->invoke(2, $formName, $form,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_postProcess'
+ );
}
/**
* an array of error messages which display a QF Error
*/
public static function validate($formName, &$fields, &$files, &$form) {
- return self::singleton()->invoke(4, $formName, $fields, $files, $form, self::$_nullObject, self::$_nullObject, 'civicrm_validate');
+ return self::singleton()
+ ->invoke(4, $formName, $fields, $files, $form, self::$_nullObject, self::$_nullObject, 'civicrm_validate');
}
/**
* an array of error messages which display a QF Error
*/
public static function validateForm($formName, &$fields, &$files, &$form, &$errors) {
- return self::singleton()->invoke(5, $formName, $fields, $files, $form, $errors, self::$_nullObject, 'civicrm_validateForm');
+ return self::singleton()
+ ->invoke(5, $formName, $fields, $files, $form, $errors, self::$_nullObject, 'civicrm_validateForm');
}
/**
* @return null the return value is ignored
*/
public static function custom($op, $groupID, $entityID, &$params) {
- return self::singleton()->invoke(4, $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom');
+ return self::singleton()
+ ->invoke(4, $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom');
}
/**
* @return null the return value is ignored
*/
public static function aclWhereClause($type, &$tables, &$whereTables, &$contactID, &$where) {
- return self::singleton()->invoke(5, $type, $tables, $whereTables, $contactID, $where, self::$_nullObject, 'civicrm_aclWhereClause');
+ return self::singleton()
+ ->invoke(5, $type, $tables, $whereTables, $contactID, $where, self::$_nullObject, 'civicrm_aclWhereClause');
}
/**
* @return null the return value is ignored
*/
public static function aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) {
- return self::singleton()->invoke(5, $type, $contactID, $tableName, $allGroups, $currentGroups, self::$_nullObject, 'civicrm_aclGroup');
+ return self::singleton()
+ ->invoke(5, $type, $contactID, $tableName, $allGroups, $currentGroups, self::$_nullObject, 'civicrm_aclGroup');
}
/**
*
* @return null
*/
- static function tokenValues(
+ public static function tokenValues(
&$details,
$contactIDs,
$jobID = NULL,
$tokens = array(),
$className = NULL
) {
- return self::singleton()->invoke(5, $details, $contactIDs, $jobID, $tokens, $className, self::$_nullObject, 'civicrm_tokenValues');
+ return self::singleton()
+ ->invoke(5, $details, $contactIDs, $jobID, $tokens, $className, self::$_nullObject, 'civicrm_tokenValues');
}
/**
* @return mixed
*/
public static function unsubscribeGroups($op, $mailingId, $contactId, &$groups, &$baseGroups) {
- return self::singleton()->invoke(5, $op, $mailingId, $contactId, $groups, $baseGroups, self::$_nullObject, 'civicrm_unsubscribeGroups');
+ return self::singleton()
+ ->invoke(5, $op, $mailingId, $contactId, $groups, $baseGroups, self::$_nullObject, 'civicrm_unsubscribeGroups');
}
/**
*
* @return mixed
*/
- static function alterPaymentProcessorParams(
+ public static function alterPaymentProcessorParams(
$paymentObj,
&$rawParams,
&$cookedParams
* @return mixed
*/
public static function caseTypes(&$caseTypes) {
- return self::singleton()->invoke(1, $caseTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseTypes');
+ return self::singleton()
+ ->invoke(1, $caseTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseTypes');
}
/**
* @return mixed
*/
public static function emailProcessor($type, &$params, $mail, &$result, $action = NULL) {
- return self::singleton()->invoke(5, $type, $params, $mail, $result, $action, self::$_nullObject, 'civicrm_emailProcessor');
+ return self::singleton()
+ ->invoke(5, $type, $params, $mail, $result, $action, self::$_nullObject, 'civicrm_emailProcessor');
}
/**
*/
public static function alterSettingsFolders(&$settingsFolders) {
return self::singleton()->invoke(1, $settingsFolders,
- self::$_nullObject, self::$_nullObject,
- self::$_nullObject, self::$_nullObject, self::$_nullObject,
- 'civicrm_alterSettingsFolders'
+ self::$_nullObject, self::$_nullObject,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_alterSettingsFolders'
);
}
*/
public static function alterSettingsMetaData(&$settingsMetaData, $domainID, $profile) {
return self::singleton()->invoke(3, $settingsMetaData,
- $domainID, $profile,
- self::$_nullObject, self::$_nullObject, self::$_nullObject,
- 'civicrm_alterSettingsMetaData'
+ $domainID, $profile,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_alterSettingsMetaData'
);
}
public static function apiWrappers(&$wrappers, $apiRequest) {
return self::singleton()
->invoke(2, $wrappers, $apiRequest, self::$_nullObject, self::$_nullObject, self::$_nullObject,
- self::$_nullObject, 'civicrm_apiWrappers'
- );
+ self::$_nullObject, 'civicrm_apiWrappers'
+ );
}
/**
* @param mixed $request
* Reserved for future use.
*/
- static function unhandledException($exception, $request = NULL) {
- self::singleton()->invoke(2, $exception, $request, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_unhandled_exception');
+ public static function unhandledException($exception, $request = NULL) {
+ self::singleton()
+ ->invoke(2, $exception, $request, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_unhandled_exception');
// == 4.4 ==
//$event = new stdClass();
//$event->exception = $exception;
* @return null the return value is ignored
*/
public static function alterBadge($labelName, &$label, &$format, &$participant) {
- return self::singleton()->invoke(4, $labelName, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge');
+ return self::singleton()
+ ->invoke(4, $labelName, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge');
}
* @return mixed
*/
public static function queryObjects(&$queryObjects, $type = 'Contact') {
- return self::singleton()->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects');
+ return self::singleton()
+ ->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects');
}
/**
* @return mixed
*/
public static function dashboard_defaults($availableDashlets, &$defaultDashlets) {
- return self::singleton()->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults');
+ return self::singleton()
+ ->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults');
}
/**
* @return void
*/
public static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
- return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge');
+ return self::singleton()
+ ->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge');
}
/**
* @return void
*/
public static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
- return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge');
+ return self::singleton()
+ ->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge');
}
/**
}
/**
- * @param array<CRM_Core_FileSearchInterface> $fileSearches
+ * @param array <CRM_Core_FileSearchInterface> $fileSearches
* @return mixed
*/
public static function fileSearches(&$fileSearches) {