You are here

function _heartbeat_map_assoc in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 heartbeat.common.inc \_heartbeat_map_assoc()
  2. 6.3 heartbeat.common.inc \_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.module, line 1684
Module file for heartbeat activity. Basic hook implementations and helper functions will be found here.

Code

function _heartbeat_map_assoc($options, $field, $value) {
  $mapped = array();
  foreach ($options as $heartbeat_activity) {
    $mapped[$heartbeat_activity->{$field}] = $heartbeat_activity->{$value};
  }
  return $mapped;
}