protected function calculateClosesAt() { $this->closesAt = $this->opensAt->copy()->addSeconds($this->length); }
/** * Check if the opening is open at a given timestamp. * * @param Carbon\Carbon $time * @return bool */ public function isOpenAt($time) { return $time->between($this->opensAt(), $this->closesAt()) || $time->copy()->addWeek()->between($this->opensAt(), $this->closesAt()); }
/** * Add Results to the Current Interval Set * * @param array */ public function addResults(array $data) { $this->results[] = array('data' => $data, 'intervalStart' => $this->currentTime->copy(), 'intervalEnd' => $this->currentTime->copy()->addSeconds($this->intervalTime)); }