start = $start; return $this; } /** * Get the time when the downtime should start * * @return int Unix timestamp */ public function getStart(): int { if ($this->start === null) { throw new \LogicException( 'You are accessing an unset property. Please make sure to set it beforehand.' ); } return $this->start; } /** * Set the time when the downtime should end * * @param int $end Unix timestamp * * @return $this */ public function setEnd(int $end): self { $this->end = $end; return $this; } /** * Get the time when the downtime should end * * @return int Unix timestamp */ public function getEnd(): int { if ($this->start === null) { throw new \LogicException( 'You are accessing an unset property. Please make sure to set it beforehand.' ); } return $this->end; } /** * Set whether it's a fixed or flexible downtime * * @param boolean $fixed * * @return $this */ public function setFixed(bool $fixed = true): self { $this->fixed = $fixed; return $this; } /** * Is the downtime fixed? * * @return boolean */ public function getFixed(): bool { return $this->fixed; } /** * Set the ID of the downtime which triggers this downtime * * @param int $triggerId * * @return $this */ public function setTriggerId(int $triggerId): self { $this->triggerId = $triggerId; return $this; } /** * Get the ID of the downtime which triggers this downtime * * @return int|null */ public function getTriggerId() { return $this->triggerId; } /** * Set the duration in seconds the downtime must last if it's a flexible downtime * * @param int $duration * * @return $this */ public function setDuration(int $duration): self { $this->duration = $duration; return $this; } /** * Get the duration in seconds the downtime must last if it's a flexible downtime * * @return int|null */ public function getDuration() { return $this->duration; } /** * Set whether to schedule a downtime for all services associated with a particular host * * @param bool $forAllServices * * @return $this */ public function setForAllServices(bool $forAllServices = true): self { $this->forAllServices = $forAllServices; return $this; } /** * Get whether to schedule a downtime for all services associated with a particular host * * @return bool */ public function getForAllServices(): bool { return $this->forAllServices; } /** * Set what to do with children * * @param CHILD_OPTION $option * * @return $this */ public function setChildOption(int $option): self { $this->childOption = $option; return $this; } /** * Get what to do with children * * @return CHILD_OPTION */ public function getChildOption(): int { return $this->childOption; } }