Previous Page
fetchOne()

Solar_Model
fetchPairs()

Next Page
fetchValue()

fetchPairs()

public array fetchPairs ( array $params default array () )

Fetches an array of key-value pairs from the model, where the first column is the key and the second column is the value.

Inherited from Solar_Sql_Model.

Parameters

  • (array) $params: An array of parameters for the fetch, with keys for 'cols', 'where', 'group', 'having', 'order', etc.

Returns

  • (array)

Description

Fetches an array of key-value pairs from the model, where the first column is the key and the second column is the value.

Recognized parameters for the fetch are:

eager
(string|array) Eager-fetch records from these related models.
distinct
(bool) Use DISTINCT?
cols
(string|array) Return only these columns; only the first two will be honored.
where
(string|array) A Solar_Sql_Select::multiWhere() value parameter to restrict which records are returned.
group
(string|array) GROUP BY these columns.
having
(string|array) HAVING these column values.
order
(string|array) ORDER BY these columns.
paging
(int) Return this many records per page.
page
(int) Return only elements from this page-number.
bind
(array) Key-value pairs to bind into the query.