File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,14 @@ public function getHasTransaction(){
138
138
return !empty ($ this ->_transaction );
139
139
}
140
140
141
+ /**
142
+ * Returns whether a multi-document transaction is in progress
143
+ * @return bool
144
+ */
145
+ public function getInTransaction (){
146
+ return $ this ->mongoSession ->isInTransaction ();
147
+ }
148
+
141
149
/**
142
150
* End current session
143
151
*/
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class Transaction extends \yii\base\BaseObject
40
40
* can [[commit()]] or [[rollBack()]].
41
41
*/
42
42
public function getIsActive (){
43
- return $ this ->clientSession ->db ->getIsActive () && $ this ->clientSession ->GetHasTransaction ();
43
+ return $ this ->clientSession ->db ->getIsActive () && $ this ->clientSession ->getInTransaction ();
44
44
}
45
45
46
46
/**
@@ -54,7 +54,7 @@ public function getIsActive(){
54
54
public function start ($ transactionOptions = []){
55
55
Command::prepareCPOptions ($ transactionOptions );
56
56
Yii::debug ('Starting mongodb transaction ... ' , __METHOD__ );
57
- if ($ this ->clientSession ->GetHasTransaction ())
57
+ if ($ this ->clientSession ->getInTransaction ())
58
58
throw new Exception ('Nested transaction not supported ' );
59
59
$ this ->clientSession ->db ->trigger (Connection::EVENT_START_TRANSACTION );
60
60
if ($ this ->clientSession ->db ->enableLogging )
You can’t perform that action at this time.
0 commit comments