Skip to content

Commit

Permalink
Merge pull request #30 from systopia/issue/28_php8_reopened
Browse files Browse the repository at this point in the history
[#28] fixed Custom Data Helper
  • Loading branch information
abugey authored Feb 7, 2023
2 parents 2f70a26 + 5d4e909 commit bc37c8b
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions CRM/Moregreetings/CustomData.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ public static function cacheCustomGroupSpecs($custom_group_ids) {

/**
* Get a mapping: custom_group_id => custom_group_name
*
* @return array
* mapping custom_group_id => custom_group_name
*/
public static function getGroup2Name() {
if (self::$custom_group2name === NULL) {
Expand Down Expand Up @@ -617,8 +620,11 @@ public static function getGroupName($custom_group_id) {
*
* @todo make it more efficient?
*
* @param array $params the parameter array as used by the API
* @param array $group_names list of group names to process. Default is: all
* @param array $params
* the parameter array as used by the API
*
* @param array $group_names
* list of group names to process. Default is: all
*/
public static function unREST(&$params, $group_names = NULL) {
if ($group_names == NULL || !is_array($group_names)) {
Expand Down Expand Up @@ -699,9 +705,14 @@ public static function createSQLJoin($group_name, $table_alias, $join_entity_id)
/**
* Get the current field value from CiviCRM's pre-hook structure
*
* @param $params pre-hook data
* @param $field_id custom field ID
* @return mixed the current value
* @param $params array
* pre-hook data
*
* @param $field_id string
* custom field ID
*
* @return mixed
* the current value
*/
public static function getPreHookCustomDataValue($params, $field_id) {
if ($field_id) {
Expand All @@ -720,9 +731,14 @@ public static function getPreHookCustomDataValue($params, $field_id) {
/**
* Set a field value in CiviCRM's pre-hook structure right in the pre hook data
*
* @param $params pre-hook data
* @param $field_id custom field ID
* @param $value the new value
* @param $params array
* pre-hook data
*
* @param $field_id string
* custom field ID
*
* @param $value mixed
* the new value
*/
public static function setPreHookCustomDataValue(&$params, $field_id, $value) {
if ($field_id) {
Expand Down

0 comments on commit bc37c8b

Please sign in to comment.