start = $start; return $this; } /** * Get the date and time when the downtime should start * * @return DateTime */ public function getStart() { return $this->start; } /** * Set the date and time when the downtime should end * * @param DateTime $end * * @return $this */ public function setEnd(DateTime $end) { $this->end = $end; return $this; } /** * Get the date and time when the downtime should end * * @return DateTime */ public function getEnd() { return $this->end; } /** * Set whether is flexible or fixed * * @param boolean $flexible * * @return $this */ public function setFlexible($flexible = true) { $this->flexible = (bool) $flexible; return $this; } /** * Is the downtime flexible? * * @return boolean */ public function getFlexible() { return $this->flexible; } /** * Set the ID of the downtime which triggers this downtime * * @param int $triggerId * * @return $this */ public function setTriggerId($triggerId) { $this->triggerId = (int) $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($duration) { $this->duration = (int) $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; } /** * (non-PHPDoc) * @see \Icinga\Module\Monitoring\Command\IcingaCommand::getCommandString() For the method documentation. */ public function getCommandString() { return sprintf( '%u;%u;%u;%u;%u;%s', $this->start->getTimestamp(), $this->end->getTimestamp(), ! $this->flexible, $this->triggerId, $this->duration, parent::getCommandString() ); } }