Previous Page
fetchNew()

Solar_Model_Areas
fetchOne()

Next Page
fetchPairs()

fetchOne()

public Solar_Sql_Model_Record fetchOne ( array $params default array () )

Fetches one record by arbitrary parameters.

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

  • (Solar_Sql_Model_Record) A record object.

Description

Fetches one record by arbitrary parameters.

Recognized parameters for the fetch are:

eager
(string|array) Eager-fetch records from these related models.
distinct
(bool) Use DISTINCT?
distinct
(bool) Is this a SELECT DISTINCT?
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.
bind
(array) Key-value pairs to bind into the query.
cache
(bool) Use the cache?
cache_key
(bool) An explicit cache key to use; otherwise, defaults to the serialized SELECT params.