Метод |
Описание |
|
__call ( string $name, array $args ) : mixed |
Get referenced row(s) by name. Suffix "List" gets many rows
Arguments are passed to where( $where, $params ) |
|
__clone ( ) |
|
|
__construct ( Database | Result | lessql\Row $parent, string $name ) |
Constructor
Use $db->createResult( $parent, $name ) instead |
|
aggregate ( string $function ) : mixed |
Execute aggregate function and return value |
|
count ( string $expr = "*" ) : integer |
Count number of rows
Implements Countable |
|
createRow ( array $data = [] ) : lessql\Row |
Create a Row for this result's table
The row is bound to this result |
|
delete ( ) : PDOStatement |
Delete all rows matched by this result |
|
execute ( ) |
Execute the select query defined by this result. |
|
fetch ( ) : lessql\Row |
Fetch the next row in this result |
|
fetchAll ( ) : lessql\Row[] |
Fetch all rows in this result |
|
getCache ( string $key ) : null | mixed |
Get value from cache |
|
getDatabase ( ) : Database |
Get the database |
|
getDefinition ( ) : string |
Get a JSON string defining the SELECT information of this Result
Used as identification in caches |
|
getGlobalKeys ( string $key ) : array |
Get global $key values of the result, i.e., disregarding its parent |
|
getIterator ( ) : ArrayIterator |
IteratorAggregate |
|
getLocalKeys ( string $key ) : array |
Get $key values of this result |
|
getParent ( ) : Result | lessql\Row |
Get parent result or row, if any |
|
getRoot ( ) : Result |
Get the root result |
|
getTable ( ) : string |
Get the table of this result |
|
insert ( array $rows, string | null $method = null ) : null | PDOStatement |
Insert one ore more rows into the table of this result
See Database::insert for information on $method |
|
isSingle ( ) : boolean |
Is this result a single association, i.e. not a list of rows? |
|
jsonSerialize ( ) : lessql\Row[] |
Implements JsonSerialize |
|
limit ( integer $count, integer | null $offset = null ) |
Set a result limit and optionally an offset |
|
max ( string $expr ) : string |
Return maximum value from an expression |
|
min ( string $expr ) : string |
Return minimum value from an expression |
|
orderBy ( string $column, string $direction = "ASC" ) |
Add an ORDER BY column and direction |
|
paged ( integer $pageSize, integer $page ) |
Set a paged limit
Pages start at 1 |
|
primaryResult ( ) : Result |
Return a new basic result which selects all rows in this result by primary key |
|
referenced ( string $name, string | array | null $where = null, array $params = [] ) : Result |
Get referenced row(s) by name. Suffix "List" gets many rows |
|
rowCount ( ) : integer |
Return number of rows in this result |
|
select ( string $expr ) : Result |
Return a new result with an additional expression to the SELECT part |
|
setCache ( string $key, mixed $value ) |
Set cache value |
|
sum ( string $expr ) : string |
Return sum of values in an expression |
|
update ( array $data ) : null | PDOStatement |
Update the rows matched by this result, setting $data |
|
via ( string $key ) : Result |
Create result with new reference key |
|
where ( string | array $condition, string | array $params = [] ) : Result |
Add a WHERE condition (multiple are combined with AND) |
|
whereNot ( string | array $column, string | array | null $value = null ) |
Add a "$column is not $value" condition to WHERE (multiple are combined with AND) |
|