# booktics/1.0.3/core/calendar/calendar-manager.php

Booktics – Appointment Booking Calendar for Service Businesses, version 1.0.3. 28 lines.

- Page: https://pluginprobe.com/plugins/booktics/1.0.3/code/core/calendar/calendar-manager.php
- Raw: https://pluginprobe.com/plugins/booktics/1.0.3/raw/core/calendar/calendar-manager.php
- Modified: 2025-07-10T13:13:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/booktics/1.0.3/code/core/calendar/calendar-manager.php#L10-L20`.

```php
<?php

namespace Booktics\Calendar;

class Calendar_Manager {
    public static function sync_team_member_calendar( int $team_member_id, string $calendar_id ): array {
        if ( $calendar = Calendar_Registry::get_calendar( $calendar_id ) ) {
            if ( $calendar->is_configured( $team_member_id ) ) {
                return $calendar->sync_events( $team_member_id );
            }
            throw new \Exception(
                sprintf(
                    'Calendar not configured for team member ID: %d',
                    intval( $team_member_id )
                )
            );
        }
        throw new \Exception( sprintf( 'Calendar not found: %s', esc_html( $calendar_id ) ) );
    }

    public static function create_calendar_event( string $calendar_id, int $team_member_id, array $event_data ): bool {
        if ( $calendar = Calendar_Registry::get_calendar( $calendar_id ) ) {
            return $calendar->create_event( array_merge( $event_data, array( 'team_member_id' => $team_member_id ) ) );
        }
        return false;
    }
}

```
