$tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupID, 'table_name');
// Retrieve the $entityId so we can pass that to the hook.
- $entityID = CRM_Core_DAO::singleValueQuery("SELECT entity_id FROM {$tableName} WHERE id = %1", [
+ $entityID = (int) CRM_Core_DAO::singleValueQuery("SELECT entity_id FROM {$tableName} WHERE id = %1", [
1 => [$customValueID, 'Integer'],
]);
CRM_Core_DAO::executeQuery($sql);
CRM_Utils_Hook::custom('delete',
- $customGroupID,
+ (int) $customGroupID,
$entityID,
$customValueID
);
$count = 1;
$firstField = reset($fields);
- $entityID = $firstField['entity_id'];
- $hookID = $firstField['custom_group_id'];
+ $entityID = (int) $firstField['entity_id'];
$isMultiple = $firstField['is_multiple'];
if (array_key_exists('id', $firstField)) {
$sqlOP = "UPDATE $tableName ";
$hookOP = 'create';
}
- CRM_Utils_Hook::customPre($hookOP,
- $hookID,
+ CRM_Utils_Hook::customPre(
+ $hookOP,
+ (int) $firstField['custom_group_id'],
$entityID,
$fields
);
CRM_Core_DAO::executeQuery($query, $params);
CRM_Utils_Hook::custom($hookOP,
- $hookID,
+ (int) $firstField['custom_group_id'],
$entityID,
$fields
);
*
* @param string $op
* The type of operation being performed.
- * @param string $groupID
+ * @param int $groupID
* The custom group ID.
- * @param object $entityID
+ * @param int $entityID
* The entityID of the row in the custom table.
* @param array $params
* The parameters that were sent into the calling function.
* @return null
* the return value is ignored
*/
- public static function custom($op, $groupID, $entityID, &$params) {
+ public static function custom(string $op, int $groupID, int $entityID, &$params) {
return self::singleton()
->invoke(['op', 'groupID', 'entityID', 'params'], $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom');
}
*
* @param string $op
* The type of operation being performed.
- * @param string $groupID
+ * @param int $groupID
* The custom group ID.
- * @param object $entityID
+ * @param int $entityID
* The entityID of the row in the custom table.
* @param array $params
* The parameters that were sent into the calling function.
* @return null
* the return value is ignored
*/
- public static function customPre($op, $groupID, $entityID, &$params) {
+ public static function customPre(string $op, int $groupID, int $entityID, array &$params) {
return self::singleton()
->invoke(['op', 'groupID', 'entityID', 'params'], $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_customPre');
}