diff --git a/application/controllers/Google.php b/application/controllers/Google.php index 066cb902..c75af08f 100644 --- a/application/controllers/Google.php +++ b/application/controllers/Google.php @@ -127,7 +127,7 @@ class Google extends EA_Controller { { $google_event = $CI->google_sync->add_appointment($appointment, $provider, $service, $customer, $settings); - $appointment['id_google_calendar'] = $google_event->id; + $appointment['id_google_calendar'] = $google_event->getId(); $CI->appointments_model->save($appointment); // Save the Google Calendar ID. } @@ -138,7 +138,7 @@ class Google extends EA_Controller { { $google_event = $CI->google_sync->get_event($provider, $appointment['id_google_calendar']); - if ($google_event->status == 'cancelled') + if ($google_event->getStatus() == 'cancelled') { throw new Exception('Event is cancelled, remove the record from Easy!Appointments.'); } diff --git a/application/libraries/Google_sync.php b/application/libraries/Google_sync.php index e9b15c00..d0046773 100644 --- a/application/libraries/Google_sync.php +++ b/application/libraries/Google_sync.php @@ -129,7 +129,7 @@ class Google_sync { public function refresh_token(string $refresh_token) { $this->initialize_clients(); - + $this->client->refreshToken($refresh_token); } @@ -370,7 +370,7 @@ class Google_sync { $calendars = []; - foreach ($calendar_list->items as $google_calendar) + foreach ($calendar_list->getItems() as $google_calendar) { if ($google_calendar->getAccessRole() === 'reader') { @@ -378,8 +378,8 @@ class Google_sync { } $calendars[] = [ - 'id' => $google_calendar->id, - 'summary' => $google_calendar->summary + 'id' => $google_calendar->getId(), + 'summary' => $google_calendar->getSummary() ]; }