parent
241f73f229
commit
ffcd33ee7e
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
||||
|
||||
class InstanceQuery extends IdoQuery
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $columnMap = array(
|
||||
'instances' => array(
|
||||
'instance_id' => 'i.instance_id',
|
||||
'instance_name' => 'i.instance_name'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function joinBaseTables()
|
||||
{
|
||||
$this->select()->from(array('i' => $this->prefix . 'instances'));
|
||||
$this->joinedVirtualTables['instances'] = true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Module\Monitoring\DataView;
|
||||
|
||||
/**
|
||||
* View representation for instances
|
||||
*/
|
||||
class Instance extends DataView
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getColumns()
|
||||
{
|
||||
return array(
|
||||
'instance_id',
|
||||
'instance_name'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSortRules()
|
||||
{
|
||||
return array(
|
||||
'instance_name' => array(
|
||||
'order' => self::SORT_ASC
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue