OperationContext
in package
Stack of the operations running in this process plus the correlation ID of the request.
Kept apart from OperationScope and without dependencies on purpose: participants (and
the Doctrine onClear listener) read it, while the scope depends on the participants, so
reading the scope from a participant would close a DI cycle.
The bottom of the stack is the root operation; frames above it are joined to it (see OperationFrame::isJoined()). The stack holds only issued frames and is emptied when the root ends, so nothing carries over to the next operation.
Table of Contents
Properties
- $joinCount : int
- $lastId : int
- $requestId : string
- $rootCount : int
- $stack : array<int, OperationFrame>
Methods
- __construct() : mixed
- getCurrent() : OperationFrame|null
- getJoinCount() : int
- Number of frames joined to the current (or last) root operation.
- getRequestId() : string
- Correlation ID of this request (CLI: of this process); the same for all its operations.
- getRoot() : OperationFrame|null
- getRootCount() : int
- Number of root operations opened so far in this request.
- nextId() : int
- push() : void
- remove() : array<int, OperationFrame>
- Removes the frame (the same instance) and every frame above it.
Properties
$joinCount
private
int
$joinCount
= 0
$lastId
private
int
$lastId
= 0
$requestId read-only
private
string
$requestId
$rootCount
private
int
$rootCount
= 0
$stack
private
array<int, OperationFrame>
$stack
= []
Methods
__construct()
public
__construct() : mixed
getCurrent()
public
getCurrent() : OperationFrame|null
Return values
OperationFrame|nullgetJoinCount()
Number of frames joined to the current (or last) root operation.
public
getJoinCount() : int
Return values
intgetRequestId()
Correlation ID of this request (CLI: of this process); the same for all its operations.
public
getRequestId() : string
Return values
stringgetRoot()
public
getRoot() : OperationFrame|null
Return values
OperationFrame|nullgetRootCount()
Number of root operations opened so far in this request.
public
getRootCount() : int
Return values
intnextId()
public
nextId() : int
Return values
intpush()
public
push(OperationFrame $frame) : void
Parameters
- $frame : OperationFrame
remove()
Removes the frame (the same instance) and every frame above it.
public
remove(OperationFrame $frame) : array<int, OperationFrame>
Parameters
- $frame : OperationFrame
Return values
array<int, OperationFrame> —the removed frames above the given one (empty when it was on top)