<?php

namespace App\Model;

use Nette;

class FreeScopesManager
{
	use Nette\SmartObject;

	private Nette\Database\Explorer $database;

	public function __construct(Nette\Database\Explorer $database)
	{
		$this->database = $database;
	}

	public function getOccupiedCapacity($from, $to)
	{
		$result = $this->database->query("SELECT * FROM `kurzy` WHERE datum_konce > ? AND datum_zacatku < ?", $from, $to);
		return $result->getRowCount();
	}
}