PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.63
Timetics – Appointment Booking Calendar & Scheduling v1.0.63
1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 All 64 releases
timetics / core / staffs / calendars / GoogleCalendarSync.php

GoogleCalendarSync.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.63, at core/staffs/calendars/GoogleCalendarSync.php

50 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Google Calendar Sync Class
4 *
5 * @package timetics
6 */
7 namespace Timetics\Core\Staffs\Calendars;
8
9 defined( 'ABSPATH' ) || exit;
10
11 use Timetics\Core\Integrations\Google\Service\Calendar;
12
13 /**
14 * Google calendar sync
15 */
16 class GoogleCalendarSync implements CalendarSyncInterface {
17
18 /**
19 * Sync booking to calendar
20 *
21 * @param array $bookingData [$bookingData description]
22 *
23 * @return bool [return description]
24 */
25 public function syncToCalendar( array $bookingData ): bool {
26 // Implement Google Calendar API call
27 return true;
28 }
29
30 /**
31 * Sync with google calendar
32 *
33 * @param string $teamMemberId Team member id
34 *
35 * @return array Calendar Event List
36 */
37 public function fetchBookings( string $teamMemberId ): array {
38 // Fetch bookings from Google Calendar API
39
40 $calendar = new Calendar();
41 $events = $calendar->get_events( $teamMemberId );
42
43 if ( ! $events ) {
44 return [];
45 }
46
47 return $events;
48 }
49 }
50