mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-02-23 09:59:25 -05:00
40 lines
957 B
PHP
40 lines
957 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 NotificationcommandCustomvar extends Model
|
|
{
|
|
public function getTableName()
|
|
{
|
|
return 'notificationcommand_customvar';
|
|
}
|
|
|
|
public function getKeyName()
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns()
|
|
{
|
|
return [
|
|
'command_id',
|
|
'customvar_id',
|
|
'environment_id'
|
|
];
|
|
}
|
|
|
|
public function createRelations(Relations $relations)
|
|
{
|
|
$relations->belongsTo('environment', Environment::class);
|
|
$relations->belongsTo('notificationcommand', Notificationcommand::class)
|
|
->setCandidateKey('command_id');
|
|
$relations->belongsTo('customvar', Customvar::class);
|
|
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
|
|
->setCandidateKey('customvar_id');
|
|
}
|
|
}
|