mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Data views: Rename getTableName() to getQueryName()
getQueryName is more obvious because the function returns the name of the query the view should use for querying.
This commit is contained in:
parent
62e044d888
commit
e804f56d5f
@ -65,15 +65,17 @@ abstract class DataView implements Filterable
|
||||
*/
|
||||
public function __construct(Backend $ds, array $columns = null)
|
||||
{
|
||||
$this->query = $ds->select()->from(static::getTableName(), $columns === null ? $this->getColumns() : $columns);
|
||||
$this->query = $ds->select()->from(static::getQueryName(), $columns === null ? $this->getColumns() : $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the queried table name
|
||||
* Get the query name this data view relies on
|
||||
*
|
||||
* By default this is this class' name without its namespace
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getTableName()
|
||||
public static function getQueryName()
|
||||
{
|
||||
$tableName = explode('\\', get_called_class());
|
||||
$tableName = end($tableName);
|
||||
|
@ -90,12 +90,7 @@ class HostStatus extends DataView
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getTableName()
|
||||
public static function getQueryName()
|
||||
{
|
||||
return 'status';
|
||||
}
|
||||
|
@ -49,16 +49,6 @@ class Hostgroup extends DataView
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the table name for this view
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getTableName()
|
||||
{
|
||||
return 'hostgroup';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve default sorting rules for particular columns. These involve sort order and potential additional to sort
|
||||
*
|
||||
|
@ -124,9 +124,7 @@ class ServiceStatus extends DataView
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function getTableName()
|
||||
public static function getQueryName()
|
||||
{
|
||||
return 'status';
|
||||
}
|
||||
|
@ -48,11 +48,6 @@ class Servicegroup extends DataView
|
||||
);
|
||||
}
|
||||
|
||||
public static function getTableName()
|
||||
{
|
||||
return 'servicegroup';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve default sorting rules for particular columns. These involve sort order and potential additional to sort
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user