mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-20 01:08:24 -04:00
40 lines
894 B
PHP
40 lines
894 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 UserCustomvar extends Model
|
|
{
|
|
public function getTableName()
|
|
{
|
|
return 'user_customvar';
|
|
}
|
|
|
|
public function getKeyName()
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns()
|
|
{
|
|
return [
|
|
'user_id',
|
|
'customvar_id',
|
|
'environment_id'
|
|
];
|
|
}
|
|
|
|
public function createRelations(Relations $relations)
|
|
{
|
|
$relations->belongsTo('environment', Environment::class);
|
|
$relations->belongsTo('user', User::class);
|
|
$relations->belongsTo('customvar', Customvar::class);
|
|
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
|
|
->setCandidateKey('customvar_id')
|
|
->setForeignKey('customvar_id');
|
|
}
|
|
}
|