/** * @param string $title * @param array $events * @param StrategyInterface|null $strategy */ public function __construct($title, array $events = array(), StrategyInterface $strategy = null) { $this->strategy = null === $strategy ? new BaseStrategy() : $strategy; $this->title = $title; $this->events = array(); $this->calendars = array(); foreach ($events as $event) { $this->add($event); } $this->cursor = 0 === count($this->events) ? TimePointFactory::now() : $this->events[0]->getInterval()->getBegin(); //$this->cursor = null; }