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-05-07 14:03:09 +02:00
|
|
|
use Icinga\Module\Monitoring\Command\IcingaCommand;
|
|
|
|
|
2014-09-11 17:18:07 +02:00
|
|
|
/**
|
|
|
|
* Delete a host or service comment
|
|
|
|
*/
|
2015-05-07 14:03:09 +02:00
|
|
|
class DeleteCommentCommand extends IcingaCommand
|
2014-09-11 17:18:07 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* ID of the comment that is to be deleted
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $commentId;
|
|
|
|
|
2015-05-07 14:03:09 +02:00
|
|
|
/**
|
|
|
|
* The type of the comment, either 'host' or 'service'
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
protected $isService = false;
|
|
|
|
|
2014-09-11 17:18:07 +02:00
|
|
|
/**
|
|
|
|
* Set the ID of the comment that is to be deleted
|
|
|
|
*
|
|
|
|
* @param int $commentId
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function setCommentId($commentId)
|
|
|
|
{
|
|
|
|
$this->commentId = (int) $commentId;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the ID of the comment that is to be deleted
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getCommentId()
|
|
|
|
{
|
|
|
|
return $this->commentId;
|
|
|
|
}
|
2015-05-07 14:03:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the command affects a service comment
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function getIsService()
|
|
|
|
{
|
|
|
|
return $this->isService;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set whether the command affects a service
|
|
|
|
*
|
|
|
|
* @param boolean $value The value, defaults to true
|
|
|
|
*
|
|
|
|
* @return this fluent interface
|
|
|
|
*/
|
|
|
|
public function setIsService($value = true)
|
|
|
|
{
|
|
|
|
$this->isService = (bool) $value;
|
|
|
|
return $this;
|
|
|
|
}
|
2014-09-11 17:18:07 +02:00
|
|
|
}
|