mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-08-20 17:28:09 +02:00
67 lines
1.4 KiB
PHP
67 lines
1.4 KiB
PHP
<?php
|
|
|
|
/* Icinga Web 2 | (c) 2022 Icinga GmbH | GPLv2+ */
|
|
|
|
namespace Icinga\Model;
|
|
|
|
use Icinga\Web\Dashboard;
|
|
use ipl\Orm\Model;
|
|
use ipl\Orm\Relations;
|
|
|
|
class ModuleDashlet extends Model
|
|
{
|
|
public function getTableName()
|
|
{
|
|
return 'icingaweb_module_dashlet';
|
|
}
|
|
|
|
public function getKeyName()
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns()
|
|
{
|
|
return [
|
|
'name',
|
|
'label',
|
|
'module',
|
|
'pane',
|
|
'url',
|
|
'description',
|
|
'priority'
|
|
];
|
|
}
|
|
|
|
public function getMetaData()
|
|
{
|
|
return [
|
|
'name' => t('Dashlet Name'),
|
|
'label' => t('Dashlet Title'),
|
|
'module' => t('Module Name'),
|
|
'pane' => t('Dashboard Pane Name'),
|
|
'url' => t('Dashlet Url'),
|
|
'description' => t('Dashlet Description'),
|
|
'priority' => t('Dashlet Order Priority')
|
|
];
|
|
}
|
|
|
|
public function getSearchColumns()
|
|
{
|
|
return ['name'];
|
|
}
|
|
|
|
public function getDefaultSort()
|
|
{
|
|
return ['name', 'priority'];
|
|
}
|
|
|
|
public function createRelations(Relations $relations)
|
|
{
|
|
$relations->belongsToMany(Dashboard\Dashlet::TABLE, Dashlet::class)
|
|
->through(SystemDashlet::class)
|
|
->setForeignKey('module_dashlet_id')
|
|
->setJoinType('LEFT');
|
|
}
|
|
}
|