TransactionAttemptContext
in package
Table of Contents
- $transaction : resource
- get() : TransactionGetResult
- Retrieves the value of a document from the collection.
- insert() : TransactionGetResult
- Inserts a new document to the collection, failing if the document already exists.
- query() : mixed
- Executes a query in the context of this transaction.
- remove() : void
- Removes a document from a collection.
- replace() : TransactionGetResult
- Replaces a document in a collection
Properties
$transaction
private
resource
$transaction
Methods
get()
Retrieves the value of a document from the collection.
public
get(Collection $collection, string $id) : TransactionGetResult
Parameters
- $collection : Collection
-
The collection the document lives in.
- $id : string
-
The document key to retrieve.
Tags
Return values
TransactionGetResult —insert()
Inserts a new document to the collection, failing if the document already exists.
public
insert(Collection $collection, string $id, mixed $value) : TransactionGetResult
Parameters
- $collection : Collection
-
The collection the document lives in.
- $id : string
-
The document key to insert.
- $value : mixed
-
the document content to insert
Tags
Return values
TransactionGetResult —query()
Executes a query in the context of this transaction.
public
query(string $statement[, TransactionQueryOptions|null $options = null ]) : mixed
Parameters
- $statement : string
- $options : TransactionQueryOptions|null = null
Tags
Return values
mixed —remove()
Removes a document from a collection.
public
remove(TransactionGetResult $document) : void
Parameters
- $document : TransactionGetResult
Tags
Return values
void —replace()
Replaces a document in a collection
public
replace(TransactionGetResult $document, mixed $value) : TransactionGetResult
Parameters
- $document : TransactionGetResult
-
the document to replace
- $value : mixed
-
the document content to replace