From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- .../Instance/ToggleInstanceFeatureCommand.php | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php (limited to 'library/Icingadb/Command/Instance') diff --git a/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php b/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php new file mode 100644 index 0000000..d275d9b --- /dev/null +++ b/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php @@ -0,0 +1,109 @@ +feature = $feature; + + return $this; + } + + /** + * Get the feature that is to be enabled or disabled + * + * @return string + */ + public function getFeature(): string + { + if ($this->feature === null) { + throw new \LogicException('You have to set the feature first before getting it.'); + } + + return $this->feature; + } + + /** + * Set whether the feature should be enabled or disabled + * + * @param bool $enabled + * + * @return $this + */ + public function setEnabled(bool $enabled = true): self + { + $this->enabled = $enabled; + + return $this; + } + + /** + * Get whether the feature should be enabled or disabled + * + * @return ?bool + */ + public function getEnabled() + { + return $this->enabled; + } +} -- cgit v1.2.3