mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-02-22 01:11:44 -05:00
40 lines
929 B
PHP
40 lines
929 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 CheckcommandCustomvar extends Model
|
|
{
|
|
public function getTableName()
|
|
{
|
|
return 'checkcommand_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('checkcommand', CheckCommand::class)
|
|
->setCandidateKey('command_id');
|
|
$relations->belongsTo('customvar', Customvar::class);
|
|
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
|
|
->setCandidateKey('customvar_id');
|
|
}
|
|
}
|