GoogleCalendarSyncHandler
in package
This handler uses https://github.com/googleapis/google-api-php-client/tree/v2.1.3
Tags
Table of Contents
- MPA_EMPLOYEE_META_KEY_GOOGLE_CALENDAR_TOKEN = 'mpa_google_calendar_token'
- MPA_RESERVATION_META_KEY_GOOGLE_CALENDAR_EVENT_ID = 'mpa_google_calendar_event_id'
- __construct() : mixed
- disconnectGoogleCalendarFromEmployee() : mixed
- getGoogleCalendarConnectionURL() : string
- isGoogleCalendarConnectedToEmployee() : bool
- addNewReservationToGoogleCalendar() : mixed
- Doc about Google calendar https://developers.google.com/calendar/api/guides/create-events#php
- collectGoogleCalendarEventData() : mixed
- deleteReservationFromGoogleCalendar() : mixed
- getGoogleAPIClient() : mixed
- Doc about authorization https://developers.google.com/identity/protocols/oauth2/web-server
- getStoredGoogleAPIToken() : array<string|int, mixed>
- saveGoogleCalendarAccessToken() : mixed
- syncBookingToGoogleCalendar() : mixed
- updateReservationInGoogleCalendar() : mixed
Constants
MPA_EMPLOYEE_META_KEY_GOOGLE_CALENDAR_TOKEN
public
mixed
MPA_EMPLOYEE_META_KEY_GOOGLE_CALENDAR_TOKEN
= 'mpa_google_calendar_token'
MPA_RESERVATION_META_KEY_GOOGLE_CALENDAR_EVENT_ID
public
mixed
MPA_RESERVATION_META_KEY_GOOGLE_CALENDAR_EVENT_ID
= 'mpa_google_calendar_event_id'
Methods
__construct()
public
__construct() : mixed
Tags
Return values
mixed —disconnectGoogleCalendarFromEmployee()
public
static disconnectGoogleCalendarFromEmployee(int $mpaEmployeeId) : mixed
Parameters
- $mpaEmployeeId : int
Tags
Return values
mixed —getGoogleCalendarConnectionURL()
public
static getGoogleCalendarConnectionURL(int $mpaEmployeeId) : string
Parameters
- $mpaEmployeeId : int
Tags
Return values
string —isGoogleCalendarConnectedToEmployee()
public
static isGoogleCalendarConnectedToEmployee(int $mpaEmployeeId) : bool
Parameters
- $mpaEmployeeId : int
Tags
Return values
bool —addNewReservationToGoogleCalendar()
Doc about Google calendar https://developers.google.com/calendar/api/guides/create-events#php
private
addNewReservationToGoogleCalendar(Booking $mpaBooking, Reservation $mpaReservation) : mixed
Parameters
- $mpaBooking : Booking
- $mpaReservation : Reservation
Tags
Return values
mixed —collectGoogleCalendarEventData()
private
collectGoogleCalendarEventData(Booking $mpaBooking, Reservation $mpaReservation) : mixed
Parameters
- $mpaBooking : Booking
- $mpaReservation : Reservation
Tags
Return values
mixed —deleteReservationFromGoogleCalendar()
private
deleteReservationFromGoogleCalendar(Reservation $mpaReservation) : mixed
Parameters
- $mpaReservation : Reservation
Tags
Return values
mixed —getGoogleAPIClient()
Doc about authorization https://developers.google.com/identity/protocols/oauth2/web-server
private
static getGoogleAPIClient(int $mpaEmployeeId) : mixed
Parameters
- $mpaEmployeeId : int
Tags
Return values
mixed —getStoredGoogleAPIToken()
private
static getStoredGoogleAPIToken(int $mpaEmployeeId) : array<string|int, mixed>
Parameters
- $mpaEmployeeId : int
Tags
Return values
array<string|int, mixed> —saveGoogleCalendarAccessToken()
private
saveGoogleCalendarAccessToken() : mixed
Tags
Return values
mixed —syncBookingToGoogleCalendar()
private
syncBookingToGoogleCalendar(Booking $mpaBooking) : mixed
Parameters
- $mpaBooking : Booking
Tags
Return values
mixed —updateReservationInGoogleCalendar()
private
updateReservationInGoogleCalendar(Booking $mpaBooking, Reservation $mpaReservation) : mixed
Parameters
- $mpaBooking : Booking
- $mpaReservation : Reservation