/**
  * Return's the courseid posted to the page.
  * If there is no posted courseid, it is pulled from the session data if avaliable,
  * otherwise false is returned.
  * @return Ambigous <boolean, integer>
  */
 private function _getCourseId()
 {
     $courseid = false;
     if (isset($_POST['course'])) {
         $courseid = $_POST['course'];
         Session::set('bookcourse_courseid', $courseid);
     } else {
         $courseid = Session::get('bookcourse_courseid');
     }
     return $courseid;
 }
 /**
  * Set the access token.
  *
  * @param string The access token
  */
 private function _setAccessToken($token)
 {
     Session::set('access_token', $token);
     $this->_client->setAccessToken($token);
 }
 /**
  * Add an attendee to the session
  * @param string $name The name of the attendee
  * @param integer $age The age of the attendee
  * @param integer $coursedateid The coursedateid they are booked on
  * @param integer $days A bitwise number for the days they are book in for
  * @param integer $courseid The courseid they are booked on
  * @return boolean true if after this method is executed, there is no attendee in local storage with the gieven id
  */
 public function addAttendee($name, $age, $coursedateid, $days, $courseid)
 {
     $savedAttendees = Session::get('booking_attendees');
     if ($savedAttendees === false) {
         $savedAttendees = array();
     }
     $id = Session::get('booking_attendee_next_id');
     if ($id === false) {
         $id = 0;
     }
     $savedAttendees[] = array('id' => $id++, 'name' => $name, 'age' => $age, 'days' => $days, 'coursedateid' => $coursedateid, 'courseid' => $courseid);
     Session::set('booking_attendees', $savedAttendees);
     Session::set('booking_attendee_next_id', $id);
     return true;
 }