/** * Toggle the is_internal field for a Workitem/Job * * The user must be internal in order to perform this action, therefore * we pass the session user to the method */ public function toggleFollowing($job_id) { $this->view = null; $workitem = new WorkItem($job_id); $resp = $workitem->toggleUserFollowing($_SESSION['userid']); echo json_encode(array('success' => true, 'message' => 'Following Toggled' . $resp)); }