monitoring/commands: Move `AddCommentCommand' to `WithCommentCommand'
`AddCommentCommand' will be the command for adding both host and service comments. refs #6593
This commit is contained in:
parent
a841b0956d
commit
d9fbbca447
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Module\Monitoring\Command\Common;
|
||||
|
||||
/**
|
||||
* Base class for commands adding comments
|
||||
*/
|
||||
abstract class WithCommentCommand extends ObjectCommand
|
||||
{
|
||||
/**
|
||||
* Author of the comment
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $author;
|
||||
|
||||
/**
|
||||
* Comment
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $comment;
|
||||
|
||||
/**
|
||||
* Set the author
|
||||
*
|
||||
* @param string $author
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthor($author)
|
||||
{
|
||||
$this->author = (string) $author;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the author
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthor()
|
||||
{
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the comment
|
||||
*
|
||||
* @param string $comment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setComment($comment)
|
||||
{
|
||||
$this->comment = (string) $comment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the comment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getComment()
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue