icingaweb2-module-director/library/vendor/ipl/Web/Table/SimpleQueryBasedTable.php

35 lines
656 B
PHP
Raw Normal View History

<?php
2017-10-09 15:23:27 +02:00
namespace dipl\Web\Table;
use Icinga\Data\SimpleQuery;
2017-10-09 15:23:27 +02:00
use dipl\Data\SimpleQueryPaginationAdapter;
abstract class SimpleQueryBasedTable extends QueryBasedTable
{
/** @var SimpleQuery */
private $query;
protected function getPaginationAdapter()
{
return new SimpleQueryPaginationAdapter($this->getQuery());
}
protected function fetchQueryRows()
{
return $this->query->fetchAll();
}
/**
* @return SimpleQuery
*/
public function getQuery()
{
if ($this->query === null) {
$this->query = $this->prepareQuery();
}
return $this->query;
}
}