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;
  }
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;
  }
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 ; }
Given a start and end time this will return the states units find themselves in for that range.

@param \DateTime $start_date
@param \DateTime $end_date
@param $reset - if set to TRUE we will refer to the Store to retrieve events

@return array
An array of states keyed by unit
Given a start and end time this will return the states units find themselves in for that range .