PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.62
Timetics – Appointment Booking Calendar & Scheduling v1.0.62
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 / CalendarSyncFactory.php

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

35 lines 918 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 defined( 'ABSPATH' ) || exit;
5
6 class CalendarSyncFactory {
7 /**
8 * Get calendar services
9 *
10 * @param string $teamMemberId Integer
11 *
12 * @return array Calendar services list
13 */
14 public static function getSyncServices(string $teamMemberId): array {
15 // Fetch all calendars configured for this team member
16 $calendars = timetics_connected_platforms( $teamMemberId );
17
18 $services = [];
19
20 foreach ( $calendars as $calendar ) {
21 switch ( $calendar ) {
22 case 'google-calendar':
23 $services[] = new GoogleCalendarSync();
24 break;
25
26 default:
27 // Do nothing for unsupported platforms
28 break;
29 }
30 }
31
32 return array_filter( $services ); // Remove any `null` values
33 }
34 }
35