Previous Page
fetchAll()

Solar_Example_Model_Users
fetchAssoc()

Next Page
fetchCol()

fetchAssoc()

public Solar_Sql_Model_Collection fetchAssoc ( array $params default array () )

The same as fetchAll(), except the record collection is keyed on the first column of the results (instead of being a strictly sequential array.) Recognized parameters for the fetch are: cols : (string|array) Return only these columns.

Inherited from Solar_Sql_Model.

Parameters

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

Returns

  • (Solar_Sql_Model_Collection) A collection object.

Description

The same as fetchAll(), except the record collection is keyed on the first column of the results (instead of being a strictly sequential array.) Recognized parameters for the fetch are: cols : (string|array) Return only these columns.

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 records from this page-number.
bind
(array) Key-value pairs to bind into the query.