mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-15 21:59:47 -04:00
Icinga DB PR: https://github.com/Icinga/icingadb/pull/385 Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com> Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
40 lines
934 B
PHP
40 lines
934 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 EventcommandCustomvar extends Model
|
|
{
|
|
public function getTableName()
|
|
{
|
|
return 'eventcommand_customvar';
|
|
}
|
|
|
|
public function getKeyName()
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns()
|
|
{
|
|
return [
|
|
'eventcommand_id',
|
|
'customvar_id',
|
|
'environment_id'
|
|
];
|
|
}
|
|
|
|
public function createRelations(Relations $relations)
|
|
{
|
|
$relations->belongsTo('environment', Environment::class);
|
|
$relations->belongsTo('eventcommand', Eventcommand::class);
|
|
$relations->belongsTo('customvar', Customvar::class);
|
|
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
|
|
->setCandidateKey('customvar_id')
|
|
->setForeignKey('customvar_id');
|
|
}
|
|
}
|