diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:28:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:28:59 +0000 |
commit | 978a1651bac3faf5e91ddba327bf39aeb6a4cb63 (patch) | |
tree | f0d1fee61877df200ccfb1c0af58a39cd551fb46 /library/Reporting/Schedule.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-reporting-978a1651bac3faf5e91ddba327bf39aeb6a4cb63.tar.xz icingaweb2-module-reporting-978a1651bac3faf5e91ddba327bf39aeb6a4cb63.zip |
Adding upstream version 0.10.0.upstream/0.10.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Reporting/Schedule.php')
-rw-r--r-- | library/Reporting/Schedule.php | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/library/Reporting/Schedule.php b/library/Reporting/Schedule.php new file mode 100644 index 0000000..e0ffa9f --- /dev/null +++ b/library/Reporting/Schedule.php @@ -0,0 +1,160 @@ +<?php +// Icinga Reporting | (c) 2018 Icinga GmbH | GPLv2 + +namespace Icinga\Module\Reporting; + +class Schedule +{ + /** @var int */ + protected $id; + + /** @var int */ + protected $reportId; + + /** @var \DateTime */ + protected $start; + + /** @var string */ + protected $frequency; + + /** @var string */ + protected $action; + + /** @var array */ + protected $config; + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @return int + */ + public function getReportId() + { + return $this->reportId; + } + + /** + * @param int $id + * + * @return $this + */ + public function setReportId($id) + { + $this->reportId = $id; + + return $this; + } + + /** + * @return \DateTime + */ + public function getStart() + { + return $this->start; + } + + /** + * @param \DateTime $start + * + * @return $this + */ + public function setStart(\DateTime $start) + { + $this->start = $start; + + return $this; + } + + /** + * @return string + */ + public function getFrequency() + { + return $this->frequency; + } + + /** + * @param string $frequency + * + * @return $this + */ + public function setFrequency($frequency) + { + $this->frequency = $frequency; + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * @param string $action + * + * @return $this + */ + public function setAction($action) + { + $this->action = $action; + + return $this; + } + + /** + * @return array + */ + public function getConfig() + { + return $this->config; + } + + /** + * @param array $config + * + * @return $this + */ + public function setConfig(array $config) + { + $this->config = $config; + + return $this; + } + + /** + * @return string + */ + public function getChecksum() + { + return \md5( + $this->getId() + . $this->getReportId() + . $this->getStart()->format('Y-m-d H:i:s') + . $this->getAction() + . $this->getFrequency() + . \json_encode($this->getConfig()) + ); + } +} |