mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-15 21:59:47 -04:00
39 lines
890 B
PHP
39 lines
890 B
PHP
<?php
|
|
|
|
/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2 */
|
|
|
|
namespace Icinga\Module\Icingadb\Model;
|
|
|
|
use ipl\Orm\Model;
|
|
use ipl\Orm\Relations;
|
|
|
|
class NotificationCustomvar extends Model
|
|
{
|
|
public function getTableName()
|
|
{
|
|
return 'notification_customvar';
|
|
}
|
|
|
|
public function getKeyName()
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns()
|
|
{
|
|
return [
|
|
'notification_id',
|
|
'customvar_id',
|
|
'environment_id'
|
|
];
|
|
}
|
|
|
|
public function createRelations(Relations $relations)
|
|
{
|
|
$relations->belongsTo('environment', Environment::class);
|
|
$relations->belongsTo('notification', Notification::class);
|
|
$relations->belongsTo('customvar', Customvar::class);
|
|
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
|
|
->setCandidateKey('customvar_id');
|
|
}
|
|
}
|