result_interface extends Countable, IteratorAggregate
Interface for immutable result container returned by the Query Engine.
Table of Contents
Methods
- first() : null|T
- Returns the first item or null.
- is_empty() : bool
- Returns true when no items were returned.
- is_not_empty() : bool
- Returns true when at least one item exists.
- is_paginated() : bool
- Indicates whether the result is paginated.
- is_std_class() : bool
- Indicates whether the items are stdClass objects instead of Domain objects.
- items() : array<int, T>
- last() : null|T
- Returns the last item or null.
- page() : null|int
- Returns current page number.
- pages() : int
- Returns total number of pages.
- perpage() : null|int
- Returns number of items per page.
- to_array() : array<int, T>
- Convert to array for JSON or external APIs.
- total() : int
- Returns total number of items matching the query, ignoring pagination.
Methods
first()
Returns the first item or null.
public
first() : null|T
Return values
null|Tis_empty()
Returns true when no items were returned.
public
is_empty() : bool
Return values
boolis_not_empty()
Returns true when at least one item exists.
public
is_not_empty() : bool
Return values
boolis_paginated()
Indicates whether the result is paginated.
public
is_paginated() : bool
Return values
boolis_std_class()
Indicates whether the items are stdClass objects instead of Domain objects.
public
is_std_class() : bool
Return values
boolitems()
public
items() : array<int, T>
Return values
array<int, T>last()
Returns the last item or null.
public
last() : null|T
Return values
null|Tpage()
Returns current page number.
public
page() : null|int
Return values
null|intpages()
Returns total number of pages.
public
pages() : int
When pagination is disabled, always returns 1.
Return values
intperpage()
Returns number of items per page.
public
perpage() : null|int
Return values
null|intto_array()
Convert to array for JSON or external APIs.
public
to_array() : array<int, T>
Directly returns internal resolved dataset.
Return values
array<int, T>total()
Returns total number of items matching the query, ignoring pagination.
public
total() : int