<?php

namespace Planaday\Entities\Booking;

use ArrayAccess;
use Countable;
use Planaday\Entities\Booking\DTO\ExtraField;
use Traversable;

class ExtraFieldCache {
	/** @var ArrayAccess<int|string, ExtraField>&Traversable<int|string, ExtraField>&Countable */
	protected ArrayAccess&Traversable&Countable $cache;

	/**
	 * @return ArrayAccess<int|string, ExtraField>&Traversable<int|string, ExtraField>&Countable
	 */
	public function get():ArrayAccess&Traversable&Countable {
		return $this->cache;
	}

	/**
	 * @param ArrayAccess<int|string, ExtraField>&Traversable<int|string, ExtraField>&Countable $extraFields
	 *
	 * @return void
	 */
	public function set( ArrayAccess&Traversable&Countable $extraFields):void {
		$this->cache = $extraFields;
	}

	public function isFilled(): bool {
		return isset($this->cache);
	}
}