<?php
/**
 * Repository Service Provider
 *
 * Registers repository services in the container
 *
 * @package NemtlyBooking
 * @since   PBOOKING_SINCE
 */

namespace NemtlyBooking\Providers;

use NemtlyBooking\Core\Service_Provider;
use NemtlyBooking\Core\Container;
use NemtlyBooking\Repositories\Event_Repository;
use NemtlyBooking\Repositories\Booking_Repository;
use NemtlyBooking\Repositories\User_Repository;

/**
 * Repository Service Provider class
 *
 * @since PBOOKING_SINCE
 */
class Repository_Service_Provider extends Service_Provider {

    /**
     * Register repository services
     *
     * @since PBOOKING_SINCE
     *
     * @param Container $container The dependency injection container.
     */
    public function register( Container $container ) {
        // Event Repository
        $container->register(
            'event_repository',
            function () {
                return new Event_Repository();
            }
        );

        // Booking Repository
        $container->register(
            'booking_repository',
            function () {
                return new Booking_Repository();
            }
        );

        // User Repository
        $container->register(
            'user_repository',
            function () {
                return new User_Repository();
            }
        );

        $this->mark_registered();
    }
}
