2021-02-04 09:02:19 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/* Icinga DB Web | (c) 2021 Icinga GmbH | GPLv2 */
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Icingadb\Command\Object;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Send custom notifications for a host or service
|
|
|
|
|
*/
|
|
|
|
|
class SendCustomNotificationCommand extends WithCommentCommand
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Whether the notification is forced
|
|
|
|
|
*
|
|
|
|
|
* Forced notifications are sent out regardless of time restrictions and whether or not notifications are enabled.
|
|
|
|
|
*
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
|
|
|
|
protected $forced;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get whether to force the notification
|
|
|
|
|
*
|
2021-09-22 04:21:15 -04:00
|
|
|
* @return ?bool
|
2021-02-04 09:02:19 -05:00
|
|
|
*/
|
|
|
|
|
public function getForced()
|
|
|
|
|
{
|
|
|
|
|
return $this->forced;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set whether to force the notification
|
|
|
|
|
*
|
|
|
|
|
* @param bool $forced
|
|
|
|
|
*
|
|
|
|
|
* @return $this
|
|
|
|
|
*/
|
2021-09-22 04:21:15 -04:00
|
|
|
public function setForced(bool $forced = true): self
|
2021-02-04 09:02:19 -05:00
|
|
|
{
|
|
|
|
|
$this->forced = $forced;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
}
|