PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.60
Timetics – Appointment Booking Calendar & Scheduling v1.0.60
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 1.0.23 1.0.24 All 62 releases
timetics / core / staffs / calendars / CalendarSyncFactory.php

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

33 lines 887 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Timetics\Core\Staffs\Calendars;
3
4 class CalendarSyncFactory {
5 /**
6 * Get calendar services
7 *
8 * @param string $teamMemberId Integer
9 *
10 * @return array Calendar services list
11 */
12 public static function getSyncServices(string $teamMemberId): array {
13 // Fetch all calendars configured for this team member
14 $calendars = timetics_connected_platforms( $teamMemberId );
15
16 $services = [];
17
18 foreach ( $calendars as $calendar ) {
19 switch ( $calendar ) {
20 case 'google-calendar':
21 $services[] = new GoogleCalendarSync();
22 break;
23
24 default:
25 // Do nothing for unsupported platforms
26 break;
27 }
28 }
29
30 return array_filter( $services ); // Remove any `null` values
31 }
32 }
33