icingadb-web/library/Icingadb/Command/Object/PropagateHostDowntimeCommand.php
Eric Lippmann 272e791390 License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-11 14:03:05 +01:00

42 lines
1.1 KiB
PHP

<?php
// SPDX-FileCopyrightText: 2021 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-3.0-or-later
namespace Icinga\Module\Icingadb\Command\Object;
/**
* Schedule and propagate host downtime
*
* @deprecated Use {@see ScheduleDowntimeCommand} instead
*/
class PropagateHostDowntimeCommand extends ScheduleHostDowntimeCommand
{
protected $childOption = ScheduleDowntimeCommand::SCHEDULE_CHILDREN;
/**
* Set whether the downtime for child hosts are all set to be triggered by this' host downtime
*
* @param bool $triggered
*
* @return $this
*/
public function setTriggered(bool $triggered = true): self
{
return $this->setChildOption(
$triggered
? ScheduleDowntimeCommand::TRIGGER_CHILDREN
: ScheduleDowntimeCommand::SCHEDULE_CHILDREN
);
}
/**
* Get whether the downtime for child hosts are all set to be triggered by this' host downtime
*
* @return bool
*/
public function getTriggered(): bool
{
return $this->getChildOption() === ScheduleDowntimeCommand::TRIGGER_CHILDREN;
}
}