summaryrefslogtreecommitdiffstats
path: root/library/Icingadb/Model/LastServiceComment.php
blob: 4d44f11ebd438f6773343d204f3fbc758dcba0f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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');
    }
}