<?php

namespace Booktics\Providers;

use Booktics\Container\Container;

/**
 * BaseServiceProvider will responsible for all appointment services
 *
 * @package Booktics/Providers
 */
abstract class Base_Service_Provider {
    /**
     * Store container
     *
     * @var Container
     */
    protected Container $container;

    /**
     * Constructor for BaseServiceProvider class
     *
     * @return  void
     */
    public function __construct() {
        $this->container = booktics_container();
        $this->register();
    }

    /**
     * Register services
     *
     * @return  void
     */
    public function register() {
        $services = $this->get_services();

        if ( $services ) {
            foreach ( $services as $service ) {
                $object = new $service();
                $object->register();
            }
        }
    }

    /**
     * Get services
     *
     * @return  array service lists
     */
    abstract public function get_services();
}
