public function populate(EventRegistryInterface $eventsRegistry, \DateTime $fromDate, \DateTime $toDate, $limit = null, array $extraFilters = array())
	{
		if ($fromDate > $toDate) {
			throw new \RangeException("'From' date should be before the 'to' date.");
		}

		$filters = array_merge(
			array(
				'fromDate' => $fromDate,
				'toDate' => $toDate,
				'limit' => $limit,
			),
			$extraFilters
		);

		$this->allEvents = $this->events = $eventsRegistry->getEvents($filters);

		if ($this->recurrentEvents = $eventsRegistry->getRecurrentEvents($filters)) {
			$this->processRecurringEvents($fromDate, $toDate, $limit);
			$this->removeOveriddenEvents();
		}

		$this->removeOutOfRangeEvents($fromDate, $toDate);

		$this->allEvents = $limit ? array_slice(array_values($this->allEvents), 0, $limit) : array_values($this->allEvents);

		return $this;
	}
public function populate(EventRegistryInterface $eventsRegistry, \DateTime $fromDate, \DateTime $toDate, $limit = null, array $extraFilters = array())
	{
		if ($fromDate > $toDate) {
			throw new \RangeException("'From' date should be before the 'to' date.");
		}

		$filters = array_merge(
			array(
				'fromDate' => $fromDate,
				'toDate' => $toDate,
				'limit' => $limit,
			),
			$extraFilters
		);

		$this->allEvents = $this->events = $eventsRegistry->getEvents($filters);

		if ($this->recurrentEvents = $eventsRegistry->getRecurrentEvents($filters)) {
			$this->processRecurringEvents($fromDate, $toDate, $limit);
			$this->removeOveriddenEvents();
		}

		$this->removeOutOfRangeEvents($fromDate, $toDate);

		$this->allEvents = $limit ? array_slice(array_values($this->allEvents), 0, $limit) : array_values($this->allEvents);

		return $this;
	}
public function populate ( EventRegistryInterface $ eventsRegistry , \ DateTime $ fromDate , \ DateTime $ toDate , $ limit = null , array $ extraFilters = array ( ) ) { if ( $ fromDate > $ toDate ) { throw new \ RangeException ( "'From' date should be before the 'to' date." ) ; } $ filters = array_merge ( array ( 'fromDate' => $ fromDate , 'toDate' => $ toDate , 'limit' => $ limit , ) , $ extraFilters ) ; $ this -> allEvents = $ this -> events = $ eventsRegistry -> getEvents ( $ filters ) ; if ( $ this -> recurrentEvents = $ eventsRegistry -> getRecurrentEvents ( $ filters ) ) { $ this -> processRecurringEvents ( $ fromDate , $ toDate , $ limit ) ; $ this -> removeOveriddenEvents ( ) ; } $ this -> removeOutOfRangeEvents ( $ fromDate , $ toDate ) ; $ this -> allEvents = $ limit ? array_slice ( array_values ( $ this -> allEvents ) , 0 , $ limit ) : array_values ( $ this -> allEvents ) ; return $ this ; }
Populates the calendar with events using an event registry and filters the results based
on other parameters.

Occurrences of recurring events are also generated at this stage.

@param  EventRegistryInterface	$eventsRegistry
@param  \DateTime				$fromDate
@param  \DateTime				$toDate
@param  int						$limit
@param  mixed[]					$extraFilters
@return static
@throws \RangeException
Populates the calendar with events using an event registry and filters the results based on other parameters .