Rename Icinga\Protocol\File\Query to ...\File\FileQuery

This commit is contained in:
Alexander Klimov 2014-09-04 15:38:14 +02:00
parent 36a3c36c1b
commit fcd12073f8
2 changed files with 17 additions and 17 deletions

View File

@ -8,13 +8,13 @@ use Icinga\Data\SimpleQuery;
use Icinga\Data\Filter\Filter; use Icinga\Data\Filter\Filter;
/** /**
* Class Query * Class FileQuery
* *
* Query for Datasource Icinga\Protocol\File\FileReader * Query for Datasource Icinga\Protocol\File\FileReader
* *
* @package Icinga\Protocol\File * @package Icinga\Protocol\File
*/ */
class Query extends SimpleQuery class FileQuery extends SimpleQuery
{ {
/** /**
* Sort direction * Sort direction
@ -41,7 +41,7 @@ class Query extends SimpleQuery
* *
* @param string $dir Sort direction, 'ASC' or 'DESC' (default) * @param string $dir Sort direction, 'ASC' or 'DESC' (default)
* *
* @return Query * @return FileQuery
*/ */
public function order($field, $direction = null) public function order($field, $direction = null)
{ {
@ -66,7 +66,7 @@ class Query extends SimpleQuery
* *
* @param string $expression the filter expression to be applied * @param string $expression the filter expression to be applied
* *
* @return Query * @return FileQuery
*/ */
public function andWhere($expression) public function andWhere($expression)
{ {

View File

@ -93,13 +93,13 @@ class FileReader extends FilterIterator
} }
/** /**
* Instantiate a Query object * Instantiate a FileQuery object
* *
* @return Query * @return FileQuery
*/ */
public function select() public function select()
{ {
return new Query($this); return new FileQuery($this);
} }
/** /**
@ -115,11 +115,11 @@ class FileReader extends FilterIterator
/** /**
* Fetch result as an array of objects * Fetch result as an array of objects
* *
* @param Query $query * @param FileQuery $query
* *
* @return array * @return array
*/ */
public function fetchAll(Query $query) public function fetchAll(FileQuery $query)
{ {
$all = array(); $all = array();
foreach ($this->fetchPairs($query) as $index => $value) { foreach ($this->fetchPairs($query) as $index => $value) {
@ -131,11 +131,11 @@ class FileReader extends FilterIterator
/** /**
* Fetch result as a key/value pair array * Fetch result as a key/value pair array
* *
* @param Query $query * @param FileQuery $query
* *
* @return array * @return array
*/ */
public function fetchPairs(Query $query) public function fetchPairs(FileQuery $query)
{ {
$skip = $query->getOffset(); $skip = $query->getOffset();
$read = $query->getLimit(); $read = $query->getLimit();
@ -173,11 +173,11 @@ class FileReader extends FilterIterator
/** /**
* Fetch first result row * Fetch first result row
* *
* @param Query $query * @param FileQuery $query
* *
* @return object * @return object
*/ */
public function fetchRow(Query $query) public function fetchRow(FileQuery $query)
{ {
$all = $this->fetchAll($query); $all = $this->fetchAll($query);
if (isset($all[0])) { if (isset($all[0])) {
@ -189,11 +189,11 @@ class FileReader extends FilterIterator
/** /**
* Fetch first result column * Fetch first result column
* *
* @param Query $query * @param FileQuery $query
* *
* @return array * @return array
*/ */
public function fetchColumn(Query $query) public function fetchColumn(FileQuery $query)
{ {
$column = array(); $column = array();
foreach ($this->fetchPairs($query) as $pair) { foreach ($this->fetchPairs($query) as $pair) {
@ -208,11 +208,11 @@ class FileReader extends FilterIterator
/** /**
* Fetch first column value from first result row * Fetch first column value from first result row
* *
* @param Query $query * @param FileQuery $query
* *
* @return mixed * @return mixed
*/ */
public function fetchOne(Query $query) public function fetchOne(FileQuery $query)
{ {
$pairs = $this->fetchPairs($query); $pairs = $this->fetchPairs($query);
if (isset($pairs[0])) { if (isset($pairs[0])) {