mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
DbConnection: Drop param $columnIndex in fetchColumn(), it's unused
This commit is contained in:
parent
cf989a0f7f
commit
f305a334d5
@ -248,14 +248,13 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch a column of all rows of the result set as an array
|
* Fetch the first column of all rows of the result set as an array
|
||||||
*
|
*
|
||||||
* @param DbQuery $query
|
* @param DbQuery $query
|
||||||
* @param int $columnIndex Index of the column to fetch
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchColumn(DbQuery $query, $columnIndex = 0)
|
public function fetchColumn(DbQuery $query)
|
||||||
{
|
{
|
||||||
return $this->dbAdapter->fetchCol($query->getSelectQuery());
|
return $this->dbAdapter->fetchCol($query->getSelectQuery());
|
||||||
}
|
}
|
||||||
|
@ -23,13 +23,11 @@ interface Fetchable
|
|||||||
public function fetchRow();
|
public function fetchRow();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch a column of all rows of the result set as an array
|
* Fetch the first column of all rows of the result set as an array
|
||||||
*
|
|
||||||
* @param int $columnIndex Index of the column to fetch
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchColumn($columnIndex = 0);
|
public function fetchColumn();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the first column of the first row of the result set
|
* Fetch the first column of the first row of the result set
|
||||||
|
@ -437,16 +437,14 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch a column of all rows of the result set as an array
|
* Fetch the first column of all rows of the result set as an array
|
||||||
*
|
|
||||||
* @param int $columnIndex Index of the column to fetch
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchColumn($columnIndex = 0)
|
public function fetchColumn()
|
||||||
{
|
{
|
||||||
Benchmark::measure('Fetching one column started');
|
Benchmark::measure('Fetching one column started');
|
||||||
$values = $this->ds->fetchColumn($this, $columnIndex);
|
$values = $this->ds->fetchColumn($this);
|
||||||
Benchmark::measure('Fetching one column finished');
|
Benchmark::measure('Fetching one column finished');
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
@ -420,23 +420,21 @@ class RepositoryQuery implements QueryInterface, Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch and return a column of all rows of the result set as an array
|
* Fetch and return the first column of all rows of the result set as an array
|
||||||
*
|
|
||||||
* @param int $columnIndex Index of the column to fetch
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchColumn($columnIndex = 0)
|
public function fetchColumn()
|
||||||
{
|
{
|
||||||
if (! $this->hasOrder()) {
|
if (! $this->hasOrder()) {
|
||||||
$this->order();
|
$this->order();
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = $this->query->fetchColumn($columnIndex);
|
$results = $this->query->fetchColumn();
|
||||||
if ($this->repository->providesValueConversion()) {
|
if ($this->repository->providesValueConversion()) {
|
||||||
$columns = $this->getColumns();
|
$columns = $this->getColumns();
|
||||||
$aliases = array_keys($columns);
|
$aliases = array_keys($columns);
|
||||||
$column = is_int($aliases[$columnIndex]) ? $columns[$columnIndex] : $aliases[$columnIndex];
|
$column = is_int($aliases[0]) ? $columns[0] : $aliases[0];
|
||||||
foreach ($results as & $value) {
|
foreach ($results as & $value) {
|
||||||
$value = $this->repository->retrieveColumn($column, $value);
|
$value = $this->repository->retrieveColumn($column, $value);
|
||||||
}
|
}
|
||||||
|
@ -490,15 +490,13 @@ abstract class DataView implements QueryInterface, IteratorAggregate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch a column of all rows of the result set as an array
|
* Fetch the first column of all rows of the result set as an array
|
||||||
*
|
|
||||||
* @param int $columnIndex Index of the column to fetch
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchColumn($columnIndex = 0)
|
public function fetchColumn()
|
||||||
{
|
{
|
||||||
return $this->getQuery()->fetchColumn($columnIndex);
|
return $this->getQuery()->fetchColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user