PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.10
Booktics – Appointment Booking Calendar for Service Businesses v1.0.10
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 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.2 1.0.3 All 31 releases
booktics / core / module / google-calendar / google-service-provider.php

google-service-provider.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.10, at core/module/google-calendar/google-service-provider.php

60 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Booktics\Module\Google_Calendar;
3
4 use Booktics\Module\Google_Calendar\Service\Calendar;
5 use Booktics\Providers\Base_Service_Provider;
6 use Booktics\Module\Google_Calendar\Controller\Calendar_Sync_Controller;
7 use Booktics\Module\Google_Calendar\Controller\Calendar_Auth_Controller;
8
9 class Google_Service_Provider extends Base_Service_Provider {
10 /**
11 * Store service instances
12 */
13 protected static $services = array();
14
15 /**
16 * Register services
17 */
18 public function register() {
19 // Register the calendar service
20 $calendar = new Calendar();
21 $calendar->register();
22
23 // Register the controller
24 $controller = new Calendar_Sync_Controller();
25 $controller->register();
26
27 // Register the auth controller
28 $auth_controller = new Calendar_Auth_Controller();
29 $auth_controller->register();
30
31 // Store instances statically
32 self::$services = array(
33 'google-calendar-service' => $calendar,
34 'google-controller' => $controller,
35 'google-auth' => $auth_controller,
36 );
37
38 // Add services to container if it exists
39 if ( property_exists( $this, 'container' ) && $this->container ) {
40 foreach ( self::$services as $key => $service ) {
41 $this->container->addServiceProvider( $key, $service );
42 }
43 }
44 }
45
46 /**
47 * Get a service instance
48 */
49 public static function get_service( $service ) {
50 return self::$services[ $service ] ?? null;
51 }
52
53 /**
54 * Get services - return empty array since we're handling registration manually
55 */
56 public function get_services() {
57 return array();
58 }
59 }
60