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)
Details
at line 51
static array
getSubscribedEvents()
at line 81
bool
isTransactional(ProviderInterface $apiProvider, array $apiRequest)
Determine if an API request should be treated as transactional.
at line 103
bool
isForceRollback(ProviderInterface $apiProvider, array $apiRequest)
Determine if caller wants us to always rollback.
at line 127
bool
isNested(ProviderInterface $apiProvider, array $apiRequest)
Determine if caller wants a nested transaction or a re-used transaction.
at line 143
onApiPrepare(PrepareEvent $event)
Open a new transaction instance (if appropriate in the current policy)
at line 159
onApiRespond(RespondEvent $event)
Close any pending transactions.
at line 175
onApiException(ExceptionEvent $event)
Rollback the pending transaction.