You are here

function analytics_get_service_instance in Analytics 7

Parameters

$service:

Return value

AnalyticsServiceInterface

Throws

\Exception

2 calls to analytics_get_service_instance()
analytics_service_edit_form in lib/export_ui/analytics_service_export_ui.inc
analytics_service_load_enabled in ./analytics.module

File

./analytics.module, line 99

Code

function analytics_get_service_instance($service) {
  $info = analytics_get_service_info();
  if (!empty($info[$service->service]['class']) && class_exists($info[$service->service]['class'])) {
    return new $info[$service->service]['class']((array) $service);
  }
  else {

    //throw new Exception("Could not find analytics service class for {$service->service}.");
  }
}