function _heartbeat_map_assoc in Heartbeat 6.3
Same name and namespace in other branches
- 6.4 heartbeat.common.inc \_heartbeat_map_assoc()
- 7 heartbeat.module \_heartbeat_map_assoc()
Helper function to map a array to dropdown with a field and value for the options
Parameters
array $options:
string target $field:
sring target $value:
Return value
array mapped for options dropdown
File
- ./
heartbeat.common.inc, line 165 - Commonly functions used in heartbeat
Code
function _heartbeat_map_assoc($options, $field, $value) {
$mapped = array();
foreach ($options as $heartbeat_activity) {
$mapped[$heartbeat_activity->{$field}] = $heartbeat_activity->{$value};
}
return $mapped;
}