monitoring/commands: Add common `ToggleFeature' command

`ToggleFeature' should be used for enabling/disabling concrete features of the monitoring host.

refs #6593
This commit is contained in:
Eric Lippmann 2014-08-29 15:45:35 +02:00
parent 4d353ac7bf
commit 8c82f1a868
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command\Common;
use Icinga\Module\Monitoring\Command\IcingaCommand;
/**
* Enable/disable features of the monitoring host
*/
abstract class ToggleFeature extends IcingaCommand
{
/**
* Whether the feature should be enabled or disabled
*
* @var bool
*/
protected $enable = true;
/**
* Enable the feature
*
* @return self
*/
public function enable()
{
$this->enable = true;
return $this;
}
/**
* Disable the feature
*
* @return self
*/
public function disable()
{
$this->enable = false;
return $this;
}
}