@@ -390,6 +390,24 @@ static PHP_METHOD(Session, endSession)
390
390
mongoc_client_session_destroy (intern -> client_session );
391
391
} /* }}} */
392
392
393
+ /* {{{ proto void MongoDB\Driver\Session::isInTransaction(void)
394
+ Returns whether a multi-document transaction is in progress */
395
+ static PHP_METHOD (Session , isInTransaction )
396
+ {
397
+ php_phongo_session_t * intern ;
398
+ SUPPRESS_UNUSED_WARNING (return_value_ptr )
399
+ SUPPRESS_UNUSED_WARNING (return_value_used )
400
+
401
+ intern = Z_SESSION_OBJ_P (getThis ());
402
+
403
+ if (zend_parse_parameters_none () == FAILURE ) {
404
+ return ;
405
+ }
406
+
407
+ RETURN_BOOL (mongoc_client_session_in_transaction (intern -> client_session ));
408
+ } /* }}} */
409
+
410
+
393
411
/* {{{ MongoDB\Driver\Session function entries */
394
412
ZEND_BEGIN_ARG_INFO_EX (ai_Session_advanceClusterTime , 0 , 0 , 1 )
395
413
ZEND_ARG_INFO (0 , clusterTime )
@@ -408,15 +426,16 @@ ZEND_END_ARG_INFO()
408
426
409
427
static zend_function_entry php_phongo_session_me [] = {
410
428
/* clang-format off */
429
+ PHP_ME (Session , abortTransaction , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
411
430
PHP_ME (Session , advanceClusterTime , ai_Session_advanceClusterTime , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
412
431
PHP_ME (Session , advanceOperationTime , ai_Session_advanceOperationTime , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
432
+ PHP_ME (Session , commitTransaction , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
433
+ PHP_ME (Session , endSession , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
413
434
PHP_ME (Session , getClusterTime , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
414
435
PHP_ME (Session , getLogicalSessionId , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
415
436
PHP_ME (Session , getOperationTime , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
437
+ PHP_ME (Session , isInTransaction , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
416
438
PHP_ME (Session , startTransaction , ai_Session_startTransaction , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
417
- PHP_ME (Session , commitTransaction , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
418
- PHP_ME (Session , abortTransaction , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
419
- PHP_ME (Session , endSession , ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
420
439
ZEND_NAMED_ME (__construct , PHP_FN (MongoDB_disabled___construct ), ai_Session_void , ZEND_ACC_PRIVATE | ZEND_ACC_FINAL )
421
440
ZEND_NAMED_ME (__wakeup , PHP_FN (MongoDB_disabled___wakeup ), ai_Session_void , ZEND_ACC_PUBLIC | ZEND_ACC_FINAL )
422
441
PHP_FE_END
0 commit comments