mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 05:14:25 +02:00
Statusdat/Query::fetchRow: Fix strict standards violation
This commit is contained in:
parent
02de834522
commit
30b37aa1e5
@ -29,6 +29,7 @@
|
|||||||
namespace Icinga\Protocol\Statusdat;
|
namespace Icinga\Protocol\Statusdat;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Filter\Query\Node;
|
use Icinga\Filter\Query\Node;
|
||||||
use Icinga\Protocol;
|
use Icinga\Protocol;
|
||||||
use Icinga\Data\BaseQuery;
|
use Icinga\Data\BaseQuery;
|
||||||
@ -37,7 +38,6 @@ use Icinga\Protocol\Statusdat\Query\IQueryPart;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Base implementation for Statusdat queries.
|
* Base implementation for Statusdat queries.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class Query extends BaseQuery
|
class Query extends BaseQuery
|
||||||
{
|
{
|
||||||
@ -409,14 +409,15 @@ class Query extends BaseQuery
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the first result row
|
* Return only the first row fetched from the result set
|
||||||
*
|
*
|
||||||
* @return MonitoringObjectList The monitoring object matching this query
|
* @return MonitoringObjectList The monitoring object matching this query
|
||||||
*/
|
*/
|
||||||
public function fetchRow()
|
public function fetchRow()
|
||||||
{
|
{
|
||||||
$result = $this->fetchAll();
|
$rs = $this->fetchAll();
|
||||||
return $result;
|
$rs->rewind();
|
||||||
|
return $rs->current();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -461,13 +462,11 @@ class Query extends BaseQuery
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch one result
|
* Return the value of the first column for the first row fetched from the result set
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function fetchOne()
|
public function fetchOne()
|
||||||
{
|
{
|
||||||
return next($this->fetchAll());
|
throw new ProgrammingError('Statusdat/Query::fetchOne not yet implemented');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -481,6 +480,4 @@ class Query extends BaseQuery
|
|||||||
$q->limit(null, null);
|
$q->limit(null, null);
|
||||||
return count($q->fetchAll());
|
return count($q->fetchAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user