icingadb-web/library/Icingadb/Model/NotificationUser.php

56 lines
1.1 KiB
PHP
Raw Permalink Normal View History

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
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\Model;
use ipl\Orm\Relations;
/**
* @property string $id
* @property string $notification_id
* @property string $user_id
* @property string $environment_id
*/
2019-09-23 09:31:18 -04:00
class NotificationUser extends Model
{
public function getTableName()
{
return 'notification_user';
}
public function getKeyName()
{
return 'id';
}
public function getColumns()
{
return [
'notification_id',
'user_id',
'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',
'notification_id',
'user_id',
'environment_id'
]));
}
2019-09-23 09:31:18 -04:00
public function createRelations(Relations $relations)
{
$relations->belongsTo('environment', Environment::class);
$relations->belongsTo('notification', Notification::class);
$relations->belongsTo('user', User::class);
}
}