public function sort()
	{
		usort($this->allEvents, function ($event1, $event2) {
			if ($event1->getStartDate() == $event2->getStartDate()) {
				return $event1->getId() < $event2->getId() ? -1 : 1;
			}

			return $event1->getStartDate() < $event2->getStartDate() ? -1 : 1;
		});

		return $this;
	}
public function sort()
	{
		usort($this->allEvents, function ($event1, $event2) {
			if ($event1->getStartDate() == $event2->getStartDate()) {
				return $event1->getId() < $event2->getId() ? -1 : 1;
			}

			return $event1->getStartDate() < $event2->getStartDate() ? -1 : 1;
		});

		return $this;
	}
public function sort ( ) { usort ( $ this -> allEvents , function ( $ event1 , $ event2 ) { if ( $ event1 -> getStartDate ( ) == $ event2 -> getStartDate ( ) ) { return $ event1 -> getId ( ) < $ event2 -> getId ( ) ? - 1 : 1 ; } return $ event1 -> getStartDate ( ) < $ event2 -> getStartDate ( ) ? - 1 : 1 ; } ) ; return $ this ; }
Sorts the events into ascending order based on their start dates.

@return static
Sorts the events into ascending order based on their start dates .