<?php

namespace Planaday\Entities\Location;

use ArrayAccess;
use Countable;
use Planaday\Entities\Location\DTO\Location;
use Planaday\Utility\DataGrouping\Collection;
use Traversable;

interface LocationDatabase {
	public function setLocation(Location $location): void;
	public function getLocationById(string $id): ?Location;

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

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

	/**
	 * @return Collection<string>
	 */
	public function getAllCities(): Collection;

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