public static function PartyPrimaryFields::getSourceKey in Party 7
Build a key for a given source.
Parameters
array $source_info: The source info for the required source. See PartyPrimaryFields::$sources for the data structure. 'data_set' and 'property' are required.
bool $ignore_value: Optionally ignore the value key. This can be used to find the parent property of a source that uses a value key.
Return value
string A key for the source property.
4 calls to PartyPrimaryFields::getSourceKey()
- PartyPrimaryFields::buildFields in includes/
party.primary_fields.inc - Build the primary field information.
- PartyPrimaryFields::buildSources in includes/
party.primary_fields.inc - Build the primary field source information.
- PartyPrimaryFields::getSource in includes/
party.primary_fields.inc - Get the info of a particular source.
- PartyPrimaryFields::sourceForm in includes/
party.primary_fields.inc - Set up a source form under the given element.
File
- includes/
party.primary_fields.inc, line 276 - Primary field related functions and callbacks.
Class
- PartyPrimaryFields
- Helper class for primary fields.
Code
public static function getSourceKey($source_info, $ignore_value = FALSE) {
// Get our information for the key in the right order.
$key_info = array(
'data_set' => $source_info['data_set'],
'property' => $source_info['property'],
);
if (!$ignore_value && $source_info['value']) {
$key_info['value'] = $source_info['value'];
}
// Build and return our key.
return implode(':', $key_info);
}