Roomify\Bat\Calendar\AbstractCalendar::getStates PHP Метод

getStates() публичный Метод

Given a start and end time this will return the states units find themselves in for that range.
public getStates ( DateTime $start_date, DateTime $end_date, $reset = TRUE ) : array
$start_date DateTime
$end_date DateTime
$reset - if set to TRUE we will refer to the Store to retrieve events
Результат array An array of states keyed by unit
    public function getStates(\DateTime $start_date, \DateTime $end_date, $reset = TRUE)
    {
        $events = $this->getEvents($start_date, $end_date, $reset);
        $states = array();
        foreach ($events as $unit => $unit_events) {
            foreach ($unit_events as $event) {
                $states[$unit][$event->getValue()] = $event->getValue();
            }
        }
        return $states;
    }