notification(s): controllers, table

This commit is contained in:
Thomas Gelf 2016-02-27 01:14:27 +01:00
parent 915b776e37
commit 30868c16a1
3 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<?php
namespace Icinga\Module\Director\Controllers;
use Icinga\Module\Director\Web\Controller\ObjectController;
class NotificationController extends ObjectController
{
}

View File

@ -0,0 +1,9 @@
<?php
namespace Icinga\Module\Director\Controllers;
use Icinga\Module\Director\Web\Controller\ObjectsController;
class NotificationsController extends ObjectsController
{
}

View File

@ -0,0 +1,50 @@
<?php
namespace Icinga\Module\Director\Tables;
use Icinga\Module\Director\Web\Table\IcingaObjectTable;
class IcingaNotificationTable extends IcingaObjectTable
{
protected $searchColumns = array(
'user',
);
public function getColumns()
{
return array(
'id' => 'n.id',
'object_type' => 'n.object_type',
'notification' => 'n.object_name',
);
}
protected function getActionUrl($row)
{
return $this->url('director/notification', array('id' => $row->id));
}
public function getTitles()
{
$view = $this->view();
return array(
'notification' => $view->translate('Notification'),
);
}
public function getUnfilteredQuery()
{
$db = $this->connection()->getConnection();
$query = $db->select()->from(
array('n' => 'icinga_notification'),
array()
);
return $query;
}
public function getBaseQuery()
{
return $this->getUnfilteredQuery();
}
}