From 7afa4dac9aef5b52a83b955fd473966ffc5a5fb3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 12 Jun 2015 12:44:35 +0200 Subject: [PATCH] Introduce query HostdowntimeendhistoryQuery refs #9009 --- .../Ido/Query/HostdowntimeendhistoryQuery.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php new file mode 100644 index 000000000..8ef831f80 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php @@ -0,0 +1,39 @@ +timestampForSql( + $this->valueToTimestamp($expression) + ); + } else { + return parent::whereToSql($col, $sign, $expression); + } + } + + /** + * {@inheritdoc} + */ + protected function joinBaseTables() + { + parent::joinBaseTables(true); + $this->select->where("hdh.actual_end_time > '1970-01-02 00:00:00'"); + $this->columnMap['history']['type'] = "('dt_end')"; + $this->columnMap['history']['timestamp'] = str_replace( + 'actual_start_time', + 'actual_end_time', + $this->columnMap['history']['timestamp'] + ); + } +}