You are here

function hook_party_acquisition_values_alter in Party 7

Alter the values being used for party acquisitions.

Some callers may specify a name context, in which case you can hook use the name specific hook, hook_party_acquisition_NAME_values_alter().

This function should be put in mymodule.party_acquisition.inc and will be automatically include when required.

Parameters

array $values: An array of party fields to match on. Keys are the field and values are the expected values.

array $context: An array of contextual information from the caller and the acquisition class. Values should be checked for their existence before being used.

1 function implements hook_party_acquisition_values_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

party_user_party_acquisition_values_alter in modules/party_user/party_user.party_acquisition.inc
Implements hook_party_acquisition_values_alter().

File

./party.api.php, line 383
Hooks provided by the Party module.

Code

function hook_party_acquisition_values_alter(&$values, array &$context) {

  // Example from party_user_party_acquisition_values_alter().
  if (!empty($context['party_user']['values_reference'])) {

    // Loop over the user values and set them. If they don't exist remove them.
    foreach ($context['party_user']['values'] as $property => &$value) {
      if (isset($values[$value])) {
        $value = $values[$value];
      }
      else {
        unset($context['party_user']['values_reference'][$property]);
      }
    }
  }
}