From d57ba80be7caf759ca1e8399df63e67ea984753a Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Sun, 3 Nov 2019 22:01:07 +0100 Subject: [PATCH] Introduce model CommentHistory --- library/Eagle/Model/CommentHistory.php | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 library/Eagle/Model/CommentHistory.php diff --git a/library/Eagle/Model/CommentHistory.php b/library/Eagle/Model/CommentHistory.php new file mode 100644 index 00000000..518c7011 --- /dev/null +++ b/library/Eagle/Model/CommentHistory.php @@ -0,0 +1,63 @@ +add(new BoolCast([ + 'is_persistent', + 'has_been_removed' + ])); + + $behaviors->add(new Timestamp([ + 'entry_time', + 'expire_time', + 'remove_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'); + } +}