<?php
/**
 * Base Service Provider
 *
 * Abstract base class for service providers
 *
 * @package NemtlyBooking
 * @since   PBOOKING_SINCE
 */

namespace NemtlyBooking\Core;

use NemtlyBooking\Interfaces\Service_Provider_Interface;

/**
 * Base Service Provider class
 *
 * @since PBOOKING_SINCE
 */
abstract class Service_Provider implements Service_Provider_Interface {

    /**
     * Whether the provider has been registered
     *
     * @var bool
     */
    protected $registered = false;

    /**
     * Whether the provider has been booted
     *
     * @var bool
     */
    protected $booted = false;

    /**
     * Register services in the container
     *
     * @since PBOOKING_SINCE
     *
     * @param Container $container The dependency injection container.
     */
    abstract public function register( Container $container );

    /**
     * Boot services after registration
     *
     * @since PBOOKING_SINCE
     *
     * @param Container $container The dependency injection container.
     */
    public function boot( Container $container ) {
        // Default implementation - can be overridden
    }

    /**
     * Check if provider is registered
     *
     * @since PBOOKING_SINCE
     *
     * @return bool
     */
    public function is_registered() {
        return $this->registered;
    }

    /**
     * Check if provider is booted
     *
     * @since PBOOKING_SINCE
     *
     * @return bool
     */
    public function is_booted() {
        return $this->booted;
    }

    /**
     * Mark provider as registered
     *
     * @since PBOOKING_SINCE
     */
    protected function mark_registered() {
        $this->registered = true;
    }

    /**
     * Mark provider as booted
     *
     * @since PBOOKING_SINCE
     */
    protected function mark_booted() {
        $this->booted = true;
    }
}
