);
/**
- * @param $numParams
+ * @param array $numParams
* @param $arg1
* @param $arg2
* @param $arg3
/**
* @param $civiModules
* @param $fnSuffix
- * @param $numParams
+ * @param array $numParams
* @param $arg1
* @param $arg2
* @param $arg3
// must be reentrant. PHP is finicky about running
// multiple loops over the same variable. The circumstances
// to reproduce the issue are pretty intricate.
- $result = $fResult = array();
+ $result = array();
if ($civiModules !== NULL) {
foreach ($civiModules as $module) {
$fnName = "{$module}_{$fnSuffix}";
if (function_exists($fnName)) {
+ $fResult = array();
switch ($numParams) {
case 0:
$fResult = $fnName();
CRM_Core_Error::fatal(ts('Invalid hook invocation'));
break;
}
- }
- if (!empty($fResult) &&
- is_array($fResult)) {
- $result = array_merge($result, $fResult);
+ if (!empty($fResult) &&
+ is_array($fResult)) {
+ $result = array_merge($result, $fResult);
+ }
}
}
}
*
* @param string $op the type of operation being performed
* @param string $objectName the name of the object
- * @param object $id the object id if available
+ * @param int $id the object id if available
* @param array $params the parameters used for object creation / editing
*
* @return null the return value is ignored
return self::singleton()->invoke(6, $op, $objectName, $objectId, $links, $mask, $values, 'civicrm_links');
}
+ /**
+ * This hook is invoked during the CiviCRM form preProcess phase.
+ *
+ * @param string $formName the name of the form
+ * @param CRM_Core_Form $form reference to the form object
+ *
+ * @return null the return value is ignored
+ */
+ static function preProcess($formName, &$form) {
+ return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess');
+ }
+
/**
* This hook is invoked when building a CiviCRM form. This hook should also
* be used to set the default values of a form element
*
* @param string $formName the name of the form
- * @param object $form reference to the form object
+ * @param CRM_Core_Form $form reference to the form object
*
* @return null the return value is ignored
*/
* any form elements, this hook should save the values in the database
*
* @param string $formName the name of the form
- * @param object $form reference to the form object
+ * @param CRM_Core_Form $form reference to the form object
*
* @return null the return value is ignored
*/
* This hook is called when building the amount structure for a Contribution or Event Page
*
* @param int $pageType - is this a contribution or event page
- * @param object $form - reference to the form object
+ * @param CRM_Core_Form $form - reference to the form object
* @param array $amount - the amount structure to be displayed
*
* @return null
/**
* @param $recordBAO
- * @param $recordID
+ * @param int $recordID
* @param $isActive
*
* @return mixed
* @param string $entity the API entity (like contact)
* @param string $action the API action (like get)
* @param array &$params the API parameters
- * @param $permissions
+ * @param array &$permissions the associative permissions array (probably to be altered by this hook)
*
* @return mixed
- * @internal param array $permisisons the associative permissions array (probably to be altered by this hook)
*/
static function alterAPIPermissions($entity, $action, &$params, &$permissions) {
return self::singleton()->invoke(4, $entity, $action, $params, $permissions,
}
/**
- * @param $dao
+ * @param CRM_Core_DAO $dao
*
* @return mixed
*/
* @return void
*/
static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
- return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, 'civicrm_pre_case_merge');
+ return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge');
}
/**
* @return void
*/
static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
- return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, 'civicrm_post_case_merge');
+ return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge');
}
/**
'civicrm_crudLink'
);
}
+
+ /**
+ * @param array<CRM_Core_FileSearchInterface> $fileSearches
+ * @return mixed
+ */
+ static function fileSearches(&$fileSearches) {
+ return self::singleton()->invoke(1, $fileSearches,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_fileSearches'
+ );
+ }
}