You are here

protected function AcquiaLiftReport::extractPotentialTargetingValues in Acquia Lift Connector 7

Extracts potential targeting values from the raw data returned by Acquia Lift.

Parameters

$items: An array of raw potential values. $return array An associative array of potential targeting features keyed by code.

1 call to AcquiaLiftReport::extractPotentialTargetingValues()
AcquiaLiftReport::loadReportData in plugins/agent_types/AcquiaLiftAgent.inc
Loads all of the data necessary to generate the reports for the agent.

File

plugins/agent_types/AcquiaLiftAgent.inc, line 2770
Provides an agent type for Acquia Lift

Class

AcquiaLiftReport
Responsible retrieving and generating reports on the Acquia Lift agent.

Code

protected function extractPotentialTargetingValues($items) {
  $data = array();
  if (isset($items['potential']['features']) && !empty($items['potential']['features'])) {
    foreach ($items['potential']['features'] as $feature) {
      $data[$feature['code']] = array(
        'type' => isset($feature['typeName']) ? $feature['typeName'] : '',
        'name' => $feature['name'] === '-' || $feature['name'] === '0' ? $feature['code'] : $feature['name'],
      );
      $data[$feature['code']]['label'] = empty($data[$feature['code']]['type']) ? $data[$feature['code']]['name'] : $data[$feature['code']]['type'] . ': ' . $data[$feature['code']]['name'];
    }
  }
  return $data;
}