2014-09-11 17:18:07 +02:00
|
|
|
<?php
|
2015-02-04 10:46:36 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2014-09-11 17:18:07 +02:00
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\Command\Object;
|
|
|
|
|
2015-04-27 18:04:10 +02:00
|
|
|
use Icinga\Module\Monitoring\Command\IcingaCommand;
|
|
|
|
|
2014-09-11 17:18:07 +02:00
|
|
|
/**
|
|
|
|
* Delete a host or service downtime
|
|
|
|
*/
|
2015-04-27 18:04:10 +02:00
|
|
|
class DeleteDowntimeCommand extends IcingaCommand
|
2014-09-11 17:18:07 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* ID of the downtime that is to be deleted
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $downtimeId;
|
2015-05-07 14:05:16 +02:00
|
|
|
|
2015-04-27 18:04:10 +02:00
|
|
|
/**
|
2015-08-21 10:30:41 +02:00
|
|
|
* Whether the command affects a service downtime
|
2015-04-27 18:04:10 +02:00
|
|
|
*
|
2015-05-07 14:05:16 +02:00
|
|
|
* @var boolean
|
2015-04-27 18:04:10 +02:00
|
|
|
*/
|
2015-05-07 14:05:16 +02:00
|
|
|
protected $isService = false;
|
|
|
|
|
2015-04-27 18:04:10 +02:00
|
|
|
/**
|
2015-08-21 10:30:41 +02:00
|
|
|
* Get the ID of the downtime that is to be deleted
|
2015-04-27 18:04:10 +02:00
|
|
|
*
|
2015-08-21 10:30:41 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getDowntimeId()
|
|
|
|
{
|
|
|
|
return $this->downtimeId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the ID of the downtime that is to be deleted
|
|
|
|
*
|
|
|
|
* @param int $downtimeId
|
2015-07-28 13:33:07 +02:00
|
|
|
*
|
|
|
|
* @return $this
|
2015-04-27 18:04:10 +02:00
|
|
|
*/
|
2015-08-21 10:30:41 +02:00
|
|
|
public function setDowntimeId($downtimeId)
|
2015-04-27 18:04:10 +02:00
|
|
|
{
|
2015-08-21 10:30:41 +02:00
|
|
|
$this->downtimeId = (int) $downtimeId;
|
2015-07-28 13:33:07 +02:00
|
|
|
return $this;
|
2015-04-27 18:04:10 +02:00
|
|
|
}
|
2015-07-28 13:33:07 +02:00
|
|
|
|
2015-04-27 18:04:10 +02:00
|
|
|
/**
|
2015-08-21 10:30:41 +02:00
|
|
|
* Get whether the command affects a service
|
2015-05-07 14:05:16 +02:00
|
|
|
*
|
2015-07-28 13:33:07 +02:00
|
|
|
* @return bool
|
2015-04-27 18:04:10 +02:00
|
|
|
*/
|
2015-05-07 14:05:16 +02:00
|
|
|
public function getIsService()
|
2015-04-27 18:04:10 +02:00
|
|
|
{
|
2015-05-07 14:05:16 +02:00
|
|
|
return $this->isService;
|
2015-04-27 18:04:10 +02:00
|
|
|
}
|
2014-09-11 17:18:07 +02:00
|
|
|
|
|
|
|
/**
|
2015-08-21 10:30:41 +02:00
|
|
|
* Set whether the command affects a service
|
2014-09-11 17:18:07 +02:00
|
|
|
*
|
2015-08-21 10:30:41 +02:00
|
|
|
* @param bool $isService
|
2014-09-11 17:18:07 +02:00
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
2015-08-21 10:30:41 +02:00
|
|
|
public function setIsService($isService = true)
|
2014-09-11 17:18:07 +02:00
|
|
|
{
|
2015-08-21 10:30:41 +02:00
|
|
|
$this->isService = (bool) $isService;
|
2014-09-11 17:18:07 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|