Documentation

Result

Result is an abstract class to to provide data, received as a result of query.

This class can modify unprocessed data, received from database and associated useful arrays with specific unserialized fields and such provided objects as date/time and other modifications.

The class implements the \IteratorAggregate interface. This allows iterating fetched results:

$rows = array();

$result = \BookTable::getList(array(
     ...
));

foreach ($result as $row)
{
     $rows[] = $row;
}

Query debugging is implemented via queries by \Bitrix\Main\Diag\SqlTracker providing sync data.

Method Description Available from version
addFetchDataModifier Modifies array by the link and returns new array. 14.5.1
addReplacedAliases Expands list of aliased columns. 14.9.2
fetch Fetches one row of the query result and returns it in the associative array. 14.0.0
fetchAll Fetches all the rows of the query result and returns it in the array of associative arrays. 14.0.0
fetchRaw Fetches one row of the query result and returns it in the associative array of raw DB data. 15.5.1
getCount Returns record count. 15.5.10
getFields Returns an array of fields according to columns in the result. 14.5.2
getResource Returns database-specific query results. 14.0.0
getSelectedRowsCount Returns the number of rows in the result. 14.0.0
getTrackerQuery Returns current query tracker. 14.0.0
setCount Sets record count. 15.5.10
setReplacedAliases Sets list of aliased columns. 14.0.0
setSerializedFields Sets internal list of fields which will be unserialized on fetch. 14.0.0


© «Bitrix24», 2001-2024
Up