diff options
Diffstat (limited to 'library/Icingadb/Model/LastServiceComment.php')
-rw-r--r-- | library/Icingadb/Model/LastServiceComment.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/library/Icingadb/Model/LastServiceComment.php b/library/Icingadb/Model/LastServiceComment.php new file mode 100644 index 0000000..4d44f11 --- /dev/null +++ b/library/Icingadb/Model/LastServiceComment.php @@ -0,0 +1,19 @@ +<?php + +/* Icinga DB Web | (c) 2023 Icinga GmbH | GPLv2 */ + +namespace Icinga\Module\Icingadb\Model; + +use ipl\Orm\Relations; + +class LastServiceComment extends Comment +{ + public function createRelations(Relations $relations): void + { + $relations->belongsTo('environment', Environment::class); + $relations->belongsTo('zone', Zone::class); + $relations->belongsTo('state', ServiceState::class) + ->setForeignKey('last_comment_id') + ->setCandidateKey('id'); + } +} |