Method |
Description |
|
__call ( $m, $a ) |
Dispatch undefined methods to SelectQuery object,
To achieve mixin-like feature. |
|
__clone ( ) |
When cloning collection object,
The resources will be free, and the
query builder will be cloned. |
|
__construct ( ) |
|
|
__toString ( ) |
|
|
add ( BaseModel $record ) |
|
|
asPairs ( string $key, string $valueKey ) |
Return pair array by columns. |
|
count ( ) |
This method implements the Countable interface. |
|
create ( array $args ) : mixed |
Create new record or relationship record,
and append the record into _rows list. |
|
createReadQuery ( ) |
|
|
delete ( ) |
|
|
each ( callable $cb ) |
|
|
fetch ( ) : OperationResult |
Build sql and Fetch from current query, make a query to database. |
|
fetchRow ( ) |
|
|
filter ( callable $cb ) |
|
|
first ( ) |
|
|
free ( ) |
Free cached row data and result handle,
But still keep the same query. |
|
fromArray ( array $list ) |
Create a collection object from an data array. |
|
getAlias ( ) |
|
|
getCurrentReadQuery ( ) |
|
|
getExplicitColumnSelect ( BaseDriver $driver ) |
xxx: this might be used in other join statements. |
|
getIterator ( ) |
|
|
getLastSql ( ) |
|
|
getQueryDriver ( $dsId ) |
Because it's used in BaseModel class too |
|
getReadQueryDriver ( ) |
|
|
getResult ( ) |
|
|
getRows ( ) |
|
|
getSchema ( ) |
|
|
getSelected ( ) |
|
|
getSql ( ) |
|
|
getTable ( ) |
|
|
getVars ( ) |
|
|
getWriteQueryDriver ( ) |
|
|
items ( ) : BaseModel[] |
Get items. |
|
join ( mixed $target, string $type = 'LEFT', string $alias = null, $relationId = null ) : QueryBuilder |
Override QueryBuilder->join method,
to enable explict selection. |
|
last ( ) |
|
|
limit ( integer $number ) |
Query Limit for QueryBuilder. |
|
loadQuery ( string $sql, array $args = [], string $dsId = null ) |
Load Collection from a SQL query statement. |
|
newModel ( ) : object |
Create model object. |
|
offset ( integer $number ) |
Query offset for QueryBuilder. |
|
offsetExists ( $name ) |
|
|
offsetGet ( $name ) |
|
|
offsetSet ( $name, $value ) |
array access interface |
|
offsetUnset ( $name ) |
|
|
page ( integer $page, integer $pageSize = 20 ) |
A Short helper method for using limit and offset of QueryBuilder. |
|
pager ( $page = 1, $pageSize = 10 ) : LazyRecord\CollectionPager |
Get selected items and wrap it into a CollectionPager object. |
|
prepareHandle ( $force = false ) |
prepare data handle, call fetch method to read data from database, and
catch the handle. |
|
queryCount ( ) : integer |
Clone current read query and apply select to count(*)
So that we can use the same conditions to query item count. |
|
reset ( ) |
Free resources and reset query,arguments and data. |
|
select ( $sels ) |
|
|
selectAll ( ) |
|
|
setAlias ( $alias ) |
|
|
setExplictSelect ( $boolean = true ) |
|
|
setPostCreate ( callable $cb ) |
|
|
setPreferredTable ( $tableName ) |
|
|
setPresetVars ( array $vars ) |
|
|
setRecords ( array $records ) |
Set record objects. |
|
size ( ) : integer |
Get current selected item size
by using php function count. |
|
splice ( $pos, $count = null ) |
|
|
sql ( ) |
|
|
toArray ( ) |
|
|
toInflatedArray ( ) |
|
|
toJson ( ) |
|
|
toLabelValuePairs ( ) |
|
|
toPairs ( $key, $valueKey ) |
|
|
toSql ( ) |
Convert query to plain sql. |
|
toXml ( ) |
|
|
toYaml ( ) |
|
|
update ( array $data ) |
Update collection. |
|
where ( array $args = null ) |
Override QueryBuilder->where method,
to enable explict selection. |
|