protected function makeRange($string) { if (strpos($string, ' - ') !== false) { list($first, $second) = explode(' - ', $string); return TimestampRange::create(new Timestamp(trim($first)), new Timestamp(trim($second))); } throw new WrongArgumentException(); }
/** * @return TimestampRange **/ public function toTimestampRange() { return TimestampRange::create($this->getStart()->toTimestamp(), $this->getEnd()->toTimestamp()); }