/** * Remove an attendee from the session * @param integer $attendeeid The id of the attendee to remove * @return boolean true if after this method is executed, there is no attendee in local storage with the gieven id */ public function removeAttendee($attendeeid) { $savedAttendees = Session::get('booking_attendees'); if ($savedAttendees === false) { return true; } $attendeekey = false; foreach ($savedAttendees as $key => $savedAttendee) { if ($savedAttendee['id'] == $attendeeid) { $attendeekey = $key; break; } } if ($attendeekey === false) { return true; } Session::clearIndex('booking_attendees', $attendeekey); if (empty(Session::get('booking_attendees'))) { Session::clear('booking_attendees'); Session::clear('booking_attendee_next_id'); } return true; }