# booktics/1.0.21/core/module/google-calendar/google-service-provider.php

Booktics – Appointment Booking Calendar for Service Businesses, version 1.0.21. 60 lines.

- Page: https://pluginprobe.com/plugins/booktics/1.0.21/code/core/module/google-calendar/google-service-provider.php
- Raw: https://pluginprobe.com/plugins/booktics/1.0.21/raw/core/module/google-calendar/google-service-provider.php
- Modified: 2025-07-29T17:39:40+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.21/code/core/module/google-calendar/google-service-provider.php#L10-L20`.

```php
<?php
namespace Booktics\Module\Google_Calendar;

use Booktics\Module\Google_Calendar\Service\Calendar;
use Booktics\Providers\Base_Service_Provider;
use Booktics\Module\Google_Calendar\Controller\Calendar_Sync_Controller;
use Booktics\Module\Google_Calendar\Controller\Calendar_Auth_Controller;

class Google_Service_Provider extends Base_Service_Provider {
    /**
     * Store service instances
     */
    protected static $services = array();

    /**
     * Register services
     */
    public function register() {
        // Register the calendar service
        $calendar = new Calendar();
        $calendar->register();

        // Register the controller
        $controller = new Calendar_Sync_Controller();
        $controller->register();

        // Register the auth controller
        $auth_controller = new Calendar_Auth_Controller();
        $auth_controller->register();

        // Store instances statically
        self::$services = array(
            'google-calendar-service' => $calendar,
            'google-controller'       => $controller,
            'google-auth'             => $auth_controller,
        );

        // Add services to container if it exists
        if ( property_exists( $this, 'container' ) && $this->container ) {
            foreach ( self::$services as $key => $service ) {
                $this->container->addServiceProvider( $key, $service );
            }
        }
    }

    /**
     * Get a service instance
     */
    public static function get_service( $service ) {
        return self::$services[ $service ] ?? null;
    }

    /**
     * Get services - return empty array since we're handling registration manually
     */
    public function get_services() {
        return array();
    }
}

```
