Solar_Sql_Adapter::fetchPairs PHP Méthode

fetchPairs() public méthode

Fetches an associative array of all rows as key-value pairs (first column is the key, second column is the value).
public fetchPairs ( array | string $spec, array $data = [] ) : array
$spec array | string An array of component parts for a SELECT, or a literal query string.
$data array An associative array of data to bind into the SELECT statement.
Résultat array
    public function fetchPairs($spec, $data = array())
    {
        $result = $this->fetchPdo($spec, $data);
        $data = array();
        while ($row = $result->fetch(PDO::FETCH_NUM)) {
            $data[$row[0]] = $row[1];
        }
        return $data;
    }