You are here

public function AcquiaLiftAPI::saveGoal in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 includes/acquia_lift.classes.inc \AcquiaLiftAPI::saveGoal()

Saves a goal to Lift.

Parameters

$name: The machine name of the goal.

File

includes/AcquiaLiftAPI.inc, line 436

Class

AcquiaLiftAPI

Code

public function saveGoal($name) {
  $goal = array(
    'id' => $name,
    'title' => $name,
    'description' => $name,
  );
  $path = "goals";
  $url = $this
    ->generateEndpoint($path);
  $vars = array(
    'name' => $name,
  );
  $success_msg = 'The Goal {name} was pushed to Acquia Lift';
  $fail_msg = 'The Goal {name} could not be pushed to Acquia Lift';
  $this
    ->makePostRequest($url, $this
    ->getPutHeaders(), $goal, $success_msg, $fail_msg, $vars);
}