Skip to content

Instantly share code, notes, and snippets.

@slave2zeros
Created July 18, 2012 00:11
Show Gist options
  • Save slave2zeros/3133104 to your computer and use it in GitHub Desktop.
Save slave2zeros/3133104 to your computer and use it in GitHub Desktop.
if ($response['status'] == 200) {
$pathInstanceId = $response['data']['PathInstance']['id'];
$this->_dataSource['PathInstance']['id'] = $pathInstanceId; // Needed for later saves.
if (array_key_exists('PathInstanceGoal', $_POST) && count($_POST['PathInstanceGoal']) > 0) {
$response = unserialize($this->apiCall(false, false, true, 'api/paths_api/addPathInstanceGoals', 'serialized'));
if($response['status'] == 200) { <--- Added this condition
if(array_key_exists('recipients', $_POST)) {
foreach ($_POST['recipients'] as $r) {
$this->_dataSource['PathInstanceUser'] = array(
'is_mentor' => Team::isMentorOfTeam($teamId, $r),
'User' => array(
'id' => $r
));
$response = unserialize($this->apiCall(false, false, true, 'api/paths_api/addPathInstanceUser', 'serialized'));
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment