mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-06-05 06:20:11 +02:00
parent
97245c5166
commit
57ea5d6d5a
@ -35,6 +35,13 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
|
|||||||
|
|
||||||
protected $isSorted = false;
|
protected $isSorted = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The cache for all filter columns
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $filterColumns;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new view
|
* Create a new view
|
||||||
*
|
*
|
||||||
@ -174,19 +181,45 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the given column is a valid filter column, i.e. the view actually provides the column or it's
|
* Check whether the given column is a valid filter column
|
||||||
* a non-queryable filter column
|
|
||||||
*
|
*
|
||||||
* @param string $column
|
* @param string $column
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isValidFilterTarget($column)
|
public function isValidFilterTarget($column)
|
||||||
{
|
{
|
||||||
return in_array($column, $this->getColumns()) || in_array($column, $this->getFilterColumns());
|
return in_array($column, $this->getFilterColumns());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all filter columns with their optional label as key
|
||||||
|
*
|
||||||
|
* This will merge the results of self::getColumns(), self::getStaticFilterColumns() and
|
||||||
|
* self::getDynamicFilterColumns() *once*. (i.e. subsequent calls of this function will
|
||||||
|
* return the same result.)
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getFilterColumns()
|
public function getFilterColumns()
|
||||||
|
{
|
||||||
|
if ($this->filterColumns === null) {
|
||||||
|
$this->filterColumns = array_merge(
|
||||||
|
$this->getColumns(),
|
||||||
|
$this->getStaticFilterColumns(),
|
||||||
|
$this->getDynamicFilterColumns()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->filterColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all static filter columns
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getStaticFilterColumns()
|
||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user