2021-02-04 09:02:19 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/* Icinga DB Web | (c) 2021 Icinga GmbH | GPLv2 */
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Icingadb\Command\Object;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Schedule and propagate host downtime
|
2024-11-12 08:13:55 -05:00
|
|
|
*
|
|
|
|
|
* @deprecated Use {@see ScheduleDowntimeCommand} instead
|
2021-02-04 09:02:19 -05:00
|
|
|
*/
|
|
|
|
|
class PropagateHostDowntimeCommand extends ScheduleHostDowntimeCommand
|
|
|
|
|
{
|
2024-11-12 08:13:55 -05:00
|
|
|
protected $childOption = ScheduleDowntimeCommand::SCHEDULE_CHILDREN;
|
2021-02-04 09:02:19 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set whether the downtime for child hosts are all set to be triggered by this' host downtime
|
|
|
|
|
*
|
|
|
|
|
* @param bool $triggered
|
|
|
|
|
*
|
|
|
|
|
* @return $this
|
|
|
|
|
*/
|
2021-09-22 04:21:15 -04:00
|
|
|
public function setTriggered(bool $triggered = true): self
|
2021-02-04 09:02:19 -05:00
|
|
|
{
|
2024-11-12 08:13:55 -05:00
|
|
|
return $this->setChildOption(
|
|
|
|
|
$triggered
|
|
|
|
|
? ScheduleDowntimeCommand::TRIGGER_CHILDREN
|
|
|
|
|
: ScheduleDowntimeCommand::SCHEDULE_CHILDREN
|
|
|
|
|
);
|
2021-02-04 09:02:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get whether the downtime for child hosts are all set to be triggered by this' host downtime
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2021-09-22 04:21:15 -04:00
|
|
|
public function getTriggered(): bool
|
2021-02-04 09:02:19 -05:00
|
|
|
{
|
2024-11-12 08:13:55 -05:00
|
|
|
return $this->getChildOption() === ScheduleDowntimeCommand::TRIGGER_CHILDREN;
|
2021-02-04 09:02:19 -05:00
|
|
|
}
|
|
|
|
|
}
|