<?php

namespace Planaday\Entities\DayPart;

use ArrayAccess;
use Countable;
use Planaday\Entities\DayPart\DTO\DayPart;
use Traversable;

interface DayPartDatabase {
	public function setDayPart(DayPart $dayPart): void;

	/**
	 * @return ArrayAccess<int|string, DayPart>&Traversable<int|string, DayPart>&Countable
	 */
	public function getDayPartsByCourseId(int $courseId): ArrayAccess&Traversable&Countable;
	public function getDayPartById(int $id): ?DayPart;

	/**
	 * @param ArrayAccess<int|string, DayPart>&Traversable<int|string, DayPart>&Countable $dayParts
	 *  @param bool $wipeDB wipe the database before inserting new day parts
	 *
	 * @return void
	 */
	public function setAll(ArrayAccess&Traversable&Countable $dayParts, bool $wipeDB = false): void;

	/**
	 * @return ArrayAccess<int|string, DayPart>&Traversable<int|string, DayPart>&Countable
	 */
	public function getAll():ArrayAccess&Traversable&Countable;

	/**
	 * @return ArrayAccess&Traversable&Countable
	 */
	public function getAllRaw(): ArrayAccess&Traversable&Countable;
	public function getCountAll(): int;
}