Collection
- Full name:
\Qubus\NoSql\Collection
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
KEY_ID | public | '_id' | |
KEY_OLD_ID | public | '_old' | |
UPDATING | public | 'updating' | |
UPDATED | public | 'updated' | |
INSERTING | public | 'inserting' | |
INSERTED | public | 'inserted' | |
DELETING | public | 'deleting' | |
DELETED | public | 'deleted' | |
CHANGED | public | 'changed' |
Properties
filepath
resolver
events
transactionMode
transactionData
macros
lastInsertId
options
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$filepath | string | |
$options | array |
macro
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string | Macro name. |
$callback | callable |
hasMacro
Check if macro exists.
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string | Macro name. |
getMacro
Return macro.
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string |
getKeyId
getKeyOldId
isModeTransaction
begin
commit
rollback
transaction
Parameters:
Parameter | Type | Description |
---|---|---|
$callback | callable | |
$that | mixed | |
$default | mixed |
Throws:
truncate
on
Parameters:
Parameter | Type | Description |
---|---|---|
$event | string | Event name. |
$callback | callable |
trigger
Parameters:
Parameter | Type | Description |
---|---|---|
$event | string | Event name. |
$args | array |
loadData
Throws:
setResolver
Parameters:
Parameter | Type | Description |
---|---|---|
$resolver | callable |
getResolver
query
where
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
filter
Parameters:
Parameter | Type | Description |
---|---|---|
$closure | \Closure |
map
Parameters:
Parameter | Type | Description |
---|---|---|
$mapper | \Closure |
sortBy
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$asc | string |
Throws:
sort
Parameters:
Parameter | Type | Description |
---|---|---|
$value | \Closure |
skip
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | int |
take
Parameters:
Parameter | Type | Description |
---|---|---|
$limit | int | |
$offset | int |
all
Throws:
find
Parameters:
Parameter | Type | Description |
---|---|---|
$id | mixed |
Throws:
lists
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed | |
$resultKey | mixed |
sum
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
count
avg
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
min
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
max
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
insert
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
Throws:
inserts
Parameters:
Parameter | Type | Description |
---|---|---|
$listData | array |
Throws:
update
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
Throws:
delete
Throws:
withOne
1:1 relation.
public withOne(\Qubus\NoSql\Collection|\Qubus\NoSql\Query $relation, string $as, string $otherKey, string $operator = '=', ?string $thisKey = null): \Qubus\NoSql\Query
Parameters:
Parameter | Type | Description |
---|---|---|
$relation | \Qubus\NoSql\Collection|\Qubus\NoSql\Query | |
$as | string | |
$otherKey | string | |
$operator | string | |
$thisKey | ?string |
Throws:
withMany
1:n relation.
public withMany(\Qubus\NoSql\Collection|\Qubus\NoSql\Query $relation, string $as, string $otherKey, string $operator = '=', ?string $thisKey = null): \Qubus\NoSql\Query
Parameters:
Parameter | Type | Description |
---|---|---|
$relation | \Qubus\NoSql\Collection|\Qubus\NoSql\Query | |
$as | string | |
$otherKey | string | |
$operator | string | |
$thisKey | ?string |
Throws:
generateKey
execute
Parameters:
Parameter | Type | Description |
---|---|---|
$query | \Qubus\NoSql\Query | |
$type | string | |
$arg | array |
Throws:
executePipes
Parameters:
Parameter | Type | Description |
---|---|---|
$pipes | array |
Throws:
executeInsert
Parameters:
Parameter | Type | Description |
---|---|---|
$query | \Qubus\NoSql\Query | |
$new | array |
Throws:
executeUpdate
Parameters:
Parameter | Type | Description |
---|---|---|
$query | \Qubus\NoSql\Query | |
$new | array |
Throws:
executeDelete
Parameters:
Parameter | Type | Description |
---|---|---|
$query | \Qubus\NoSql\Query |
Throws:
executeGet
Parameters:
Parameter | Type | Description |
---|---|---|
$query | \Qubus\NoSql\Query |
Throws:
executeSave
Parameters:
Parameter | Type | Description |
---|---|---|
$query | \Qubus\NoSql\Query |
Throws:
persists
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
save
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
lastInsertId
Returns the last insert id from the current document being acted upon.
Return Value:
The last insert id.
__call
Parameters:
Parameter | Type | Description |
---|---|---|
$method | mixed | |
$args | mixed |
Throws:
Automatically generated on 2025-10-13