DbConnection: Drop param $columnIndex in fetchColumn(), it's unused

This commit is contained in:
Johannes Meyer 2015-05-19 09:48:20 +02:00
parent cf989a0f7f
commit f305a334d5
5 changed files with 14 additions and 23 deletions

View File

@ -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 int $columnIndex Index of the column to fetch
*
* @return array
*/
public function fetchColumn(DbQuery $query, $columnIndex = 0)
public function fetchColumn(DbQuery $query)
{
return $this->dbAdapter->fetchCol($query->getSelectQuery());
}

View File

@ -23,13 +23,11 @@ interface Fetchable
public function fetchRow();
/**
* Fetch a column of all rows of the result set as an array
*
* @param int $columnIndex Index of the column to fetch
* Fetch the first column of all rows of the result set as an array
*
* @return array
*/
public function fetchColumn($columnIndex = 0);
public function fetchColumn();
/**
* Fetch the first column of the first row of the result set

View File

@ -437,16 +437,14 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
}
/**
* Fetch a column of all rows of the result set as an array
*
* @param int $columnIndex Index of the column to fetch
* Fetch the first column of all rows of the result set as an array
*
* @return array
*/
public function fetchColumn($columnIndex = 0)
public function fetchColumn()
{
Benchmark::measure('Fetching one column started');
$values = $this->ds->fetchColumn($this, $columnIndex);
$values = $this->ds->fetchColumn($this);
Benchmark::measure('Fetching one column finished');
return $values;
}

View File

@ -420,23 +420,21 @@ class RepositoryQuery implements QueryInterface, Iterator
}
/**
* Fetch and return a column of all rows of the result set as an array
*
* @param int $columnIndex Index of the column to fetch
* Fetch and return the first column of all rows of the result set as an array
*
* @return array
*/
public function fetchColumn($columnIndex = 0)
public function fetchColumn()
{
if (! $this->hasOrder()) {
$this->order();
}
$results = $this->query->fetchColumn($columnIndex);
$results = $this->query->fetchColumn();
if ($this->repository->providesValueConversion()) {
$columns = $this->getColumns();
$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) {
$value = $this->repository->retrieveColumn($column, $value);
}

View File

@ -490,15 +490,13 @@ abstract class DataView implements QueryInterface, IteratorAggregate
}
/**
* Fetch a column of all rows of the result set as an array
*
* @param int $columnIndex Index of the column to fetch
* Fetch the first column of all rows of the result set as an array
*
* @return array
*/
public function fetchColumn($columnIndex = 0)
public function fetchColumn()
{
return $this->getQuery()->fetchColumn($columnIndex);
return $this->getQuery()->fetchColumn();
}
/**