From 23f2ec65aebe0de7dcff8a9efa040bb8ac2c8134 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Sun, 3 Nov 2019 22:04:10 +0100 Subject: [PATCH] Introduce model StateHistory --- library/Eagle/Model/StateHistory.php | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 library/Eagle/Model/StateHistory.php diff --git a/library/Eagle/Model/StateHistory.php b/library/Eagle/Model/StateHistory.php new file mode 100644 index 00000000..dfaf3663 --- /dev/null +++ b/library/Eagle/Model/StateHistory.php @@ -0,0 +1,58 @@ +add(new Timestamp([ + 'event_time' + ])); + } + + public function createRelations(Relations $relations) + { + $relations->belongsTo('endpoint', Endpoint::class); + $relations->belongsTo('environment', Environment::class); + $relations->belongsTo('host', Host::class)->setJoinType('LEFT'); + $relations->belongsTo('service', Service::class)->setJoinType('LEFT'); + } +}