TransactionSubscriber
class TransactionSubscriber implements EventSubscriberInterface
Class TransactionSubscriber
Implement transaction management for API calls. Two API options are accepted: - is_transactional: bool|'nest' - if true, then all work is done inside a transaction. By default, true for mutator actions (C-UD). 'nest' will force creation of a nested transaction; otherwise, the default is to re-use any existing transactions. - options.force_rollback: bool - if true, all work is done in a nested transaction which will be rolled back.
Methods
No description
Determine if an API request should be treated as transactional.
Determine if caller wants us to always rollback.
Determine if caller wants a nested transaction or a re-used transaction.
Open a new transaction instance (if appropriate in the current policy)
Close any pending transactions.
Rollback the pending transaction.
Details
at line 50
static array
getSubscribedEvents()
at line 80
bool
isTransactional(ProviderInterface $apiProvider, array $apiRequest)
Determine if an API request should be treated as transactional.
at line 99
bool
isForceRollback(ProviderInterface $apiProvider, array $apiRequest)
Determine if caller wants us to always rollback.
at line 120
bool
isNested(ProviderInterface $apiProvider, array $apiRequest)
Determine if caller wants a nested transaction or a re-used transaction.
at line 136
onApiPrepare( $event)
Open a new transaction instance (if appropriate in the current policy)
at line 152
onApiRespond( $event)
Close any pending transactions.
at line 168
onApiException( $event)
Rollback the pending transaction.