function party_get_party_data_sets in Party 7
Same name and namespace in other branches
- 8.2 party.module \party_get_party_data_sets()
Get the data sets expected for a party.
@todo: rename this function; the name is ambiguous.
@todo: Consider caching against the set of hats rather than the party id.
Parameters
$party: The party object in question.
Return value
An array of data set names.
4 calls to party_get_party_data_sets()
- party_devel_generate_party_add_party in modules/
party_devel/ devel_generate.inc - Create one party. Used by both batch and non-batch code branches.
- party_edit_form_form in plugins/
content_types/ party_edit_form.inc - Form
- party_form in ./
party.pages.inc - Party edit form.
- party_hat_party_access in modules/
party_hat/ party_hat.party.inc - Implements hook_party_access().
File
- ./
party.module, line 755 - Provides a generic CRM party entity.
Code
function party_get_party_data_sets($party) {
$party_data_sets =& drupal_static(__FUNCTION__);
// If the sets have already been worked out return the cached list.
if (isset($party->pid) && !empty($party_data_sets[$party->pid])) {
return $party_data_sets[$party->pid];
}
$data_sets = array_keys(party_get_data_set_info());
// Allow modules to alter the party data sets.
drupal_alter('party_data_sets', $data_sets, $party);
// If a pid is set cache the result.
if (isset($party->pid)) {
$party_data_sets[$party->pid] = $data_sets;
}
return $data_sets;
}