Result extends Result
Decorates base Result, adds new method fetchObject().
Tags
Table of Contents
Methods
- __construct() : mixed
- addFetchDataModifier() : void
- Modifier should accept once fetched array as an argument, then modify by link or return new array: - function (&$data) { $data['AGE'] -= 7; } - function ($data) { $data['AGE'] -= 7; return $data; }
- addReplacedAliases() : void
- Extends list of aliased columns.
- fetch() : array<string|int, mixed>|false
- Fetches one row of the query result and returns it in the associative array of converted data or false on empty data.
- fetchAll() : array<string|int, mixed>
- Fetches all the rows of the query result and returns it in the array of associative arrays.
- fetchCollection() : null
- fetchObject() : null
- fetchRaw() : array<string|int, mixed>|false
- Fetches one row of the query result and returns it in the associative array of raw DB data or false on empty data.
- getConverters() : array<string|int, callable>
- getCount() : int
- Returns record count. It's required to set record count explicitly before.
- getFields() : array<string|int, ScalarField>
- Returns an array of fields according to columns in the result.
- getFieldsCount() : int
- Returns the number of fields in the result.
- getIdentityMap() : IdentityMap
- getIterator() : Traversable
- Retrieve an external iterator
- getLength() : int
- Returns the size in bytes of the last fetched row.
- getResource() : null|resource
- Returns database-specific resource of this result.
- getSelectedRowsCount() : int
- Returns the number of rows in the result.
- getTrackerQuery() : SqlTrackerQuery|null
- Returns current query tracker.
- hasBigFields() : bool
- Checks the existence of the big fields in the result.
- setConverters() : mixed
- setCount() : mixed
- Sets record count.
- setHiddenObjectFields() : mixed
- setIdentityMap() : Result
- Sets custom identity map
- setReplacedAliases() : void
- Sets list of aliased columns.
- setSerializedFields() : void
- Sets internal list of fields which will be unserialized on fetch.
Methods
__construct()
public
__construct(Query $query, Result $result) : mixed
Parameters
addFetchDataModifier()
Modifier should accept once fetched array as an argument, then modify by link or return new array: - function (&$data) { $data['AGE'] -= 7; } - function ($data) { $data['AGE'] -= 7; return $data; }
public
addFetchDataModifier(mixed $fetchDataModifier) : void
Parameters
- $fetchDataModifier : mixed
-
Valid callback.
addReplacedAliases()
Extends list of aliased columns.
public
addReplacedAliases(array<string|int, mixed> $replacedAliases) : void
Parameters
- $replacedAliases : array<string|int, mixed>
-
Aliases map from tech to human.
fetch()
Fetches one row of the query result and returns it in the associative array of converted data or false on empty data.
public
fetch([Converter $converter = null ]) : array<string|int, mixed>|false
Parameters
- $converter : Converter = null
-
Optional converter to encode data on fetching.
Return values
array<string|int, mixed>|falsefetchAll()
Fetches all the rows of the query result and returns it in the array of associative arrays.
public
fetchAll([Converter $converter = null ]) : array<string|int, mixed>
Returns an empty array if query has no data.
Parameters
- $converter : Converter = null
-
Optional converter to encode data on fetching.
Return values
array<string|int, mixed>fetchCollection()
public
final fetchCollection() : null
Tags
Return values
null —Actual type should be annotated by orm:annotate
fetchObject()
public
final fetchObject() : null
Tags
Return values
null —Actual type should be annotated by orm:annotate
fetchRaw()
Fetches one row of the query result and returns it in the associative array of raw DB data or false on empty data.
public
fetchRaw() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetConverters()
public
getConverters() : array<string|int, callable>
Return values
array<string|int, callable>getCount()
Returns record count. It's required to set record count explicitly before.
public
getCount() : int
Return values
intgetFields()
Returns an array of fields according to columns in the result.
public
getFields() : array<string|int, ScalarField>
Return values
array<string|int, ScalarField>getFieldsCount()
Returns the number of fields in the result.
public
getFieldsCount() : int
Return values
intgetIdentityMap()
public
getIdentityMap() : IdentityMap
Return values
IdentityMapgetIterator()
Retrieve an external iterator
public
getIterator() : Traversable
Return values
Traversable —An instance of an object implementing Iterator or Traversable
getLength()
Returns the size in bytes of the last fetched row.
public
getLength() : int
Return values
intgetResource()
Returns database-specific resource of this result.
public
getResource() : null|resource
Return values
null|resourcegetSelectedRowsCount()
Returns the number of rows in the result.
public
getSelectedRowsCount() : int
Return values
intgetTrackerQuery()
Returns current query tracker.
public
getTrackerQuery() : SqlTrackerQuery|null
Return values
SqlTrackerQuery|nullhasBigFields()
Checks the existence of the big fields in the result.
public
hasBigFields() : bool
Return values
boolsetConverters()
public
setConverters(mixed $converters) : mixed
Parameters
- $converters : mixed
setCount()
Sets record count.
public
setCount(mixed $n) : mixed
Parameters
- $n : mixed
setHiddenObjectFields()
public
setHiddenObjectFields(array<string|int, string> $hiddenObjectFields) : mixed
Parameters
- $hiddenObjectFields : array<string|int, string>
setIdentityMap()
Sets custom identity map
public
setIdentityMap(IdentityMap $map) : Result
Parameters
- $map : IdentityMap
Return values
ResultsetReplacedAliases()
Sets list of aliased columns.
public
setReplacedAliases(array<string|int, mixed> $replacedAliases) : void
This allows to overcome database limits on length of the column names.
Parameters
- $replacedAliases : array<string|int, mixed>
-
Aliases map from tech to human.
setSerializedFields()
Sets internal list of fields which will be unserialized on fetch.
public
setSerializedFields(array<string|int, mixed> $serializedFields) : void
Parameters
- $serializedFields : array<string|int, mixed>
-
List of fields.