You are here

public static function AcquiaLiftLearn::create in Acquia Lift Connector 7.2

Implements PersonalizeAgentInterface::create().

File

plugins/agent_types/AcquiaLiftLearn.inc, line 37
Provides a learning agent class for Acquia Lift

Class

AcquiaLiftLearn
@file Provides a learning agent class for Acquia Lift

Code

public static function create($agent_data) {
  try {
    $acquia_lift_api = self::getAPIInstance();
    $status = personalize_agent_get_status($agent_data->machine_name);
    return new static($agent_data->machine_name, $agent_data->label, $agent_data->data, $status, !empty($agent_data->started) ? $agent_data->started : NULL, $acquia_lift_api);
  } catch (AcquiaLiftException $e) {
    watchdog('Acquia Lift', 'Unable to instantiate Acquia Lift Learning Agent');
    return NULL;
  }
}