<?php

namespace Planaday\Database\InMemoryDatabase;

use Planaday\Database\Abstraction\DatabaseConnector;
use Planaday\Entities\Booking\BookingDatabase;
use Planaday\Entities\Course\CourseDatabase;
use Planaday\Entities\DayPart\DayPartDatabase;
use Planaday\Entities\Location\LocationDatabase;
use Planaday\Utility\DependencyInjection\Container;

class InMemoryDatabaseConnector implements DatabaseConnector {
	public function __construct(
		protected Container $registry
	) {}

	public function getDatabaseName(): string {
		return "InMemory";
	}

	public function connect(): void {
		$this->registry->setImplementation(LocationDatabase::class, InMemoryLocationDB::class)
		               ->setImplementation(CourseDatabase::class, InMemoryCourseDB::class)
		               ->setImplementation(DayPartDatabase::class, InMemoryDayPartDB::class)
		               ->setImplementation(BookingDatabase::class, InMemoryBookingDB::class);
	}
}