2019-09-23 09:31:18 -04:00
|
|
|
<?php
|
|
|
|
|
|
2020-03-13 03:38:01 -04:00
|
|
|
/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2 */
|
|
|
|
|
|
2019-11-04 19:07:30 -05:00
|
|
|
namespace Icinga\Module\Icingadb\Model;
|
2019-09-23 09:31:18 -04:00
|
|
|
|
2025-10-16 02:42:51 -04:00
|
|
|
use Icinga\Module\Icingadb\Common\Model;
|
2022-05-19 10:28:45 -04:00
|
|
|
use ipl\Orm\Behavior\Binary;
|
2022-03-29 09:27:18 -04:00
|
|
|
use ipl\Orm\Behaviors;
|
2019-09-23 09:31:18 -04:00
|
|
|
use ipl\Orm\Relations;
|
|
|
|
|
|
2024-01-23 02:43:02 -05:00
|
|
|
/**
|
|
|
|
|
* @property string $id
|
|
|
|
|
* @property string $checkcommand_id
|
|
|
|
|
* @property string $customvar_id
|
|
|
|
|
* @property string $environment_id
|
|
|
|
|
*/
|
2019-09-23 09:31:18 -04:00
|
|
|
class CheckcommandCustomvar extends Model
|
|
|
|
|
{
|
|
|
|
|
public function getTableName()
|
|
|
|
|
{
|
|
|
|
|
return 'checkcommand_customvar';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getKeyName()
|
|
|
|
|
{
|
|
|
|
|
return 'id';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getColumns()
|
|
|
|
|
{
|
|
|
|
|
return [
|
2021-10-18 11:45:34 -04:00
|
|
|
'checkcommand_id',
|
2019-09-23 09:31:18 -04:00
|
|
|
'customvar_id',
|
2019-10-02 01:51:47 -04:00
|
|
|
'environment_id'
|
2019-09-23 09:31:18 -04:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-29 09:27:18 -04:00
|
|
|
public function createBehaviors(Behaviors $behaviors)
|
|
|
|
|
{
|
|
|
|
|
$behaviors->add(new Binary([
|
|
|
|
|
'id',
|
|
|
|
|
'checkcommand_id',
|
|
|
|
|
'customvar_id',
|
|
|
|
|
'environment_id'
|
|
|
|
|
]));
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-23 09:31:18 -04:00
|
|
|
public function createRelations(Relations $relations)
|
|
|
|
|
{
|
|
|
|
|
$relations->belongsTo('environment', Environment::class);
|
2023-08-16 10:48:57 -04:00
|
|
|
$relations->belongsTo('checkcommand', Checkcommand::class);
|
2019-09-23 09:31:18 -04:00
|
|
|
$relations->belongsTo('customvar', Customvar::class);
|
|
|
|
|
$relations->belongsTo('customvar_flat', CustomvarFlat::class)
|
2020-11-03 05:27:26 -05:00
|
|
|
->setCandidateKey('customvar_id')
|
|
|
|
|
->setForeignKey('customvar_id');
|
2019-09-23 09:31:18 -04:00
|
|
|
}
|
|
|
|
|
}
|