This repository was archived by the owner on Aug 24, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -104,25 +104,19 @@ protected static function committedDelete($callback)
104104 */
105105 protected function markNativeEventForCommitAction ($ commitAction )
106106 {
107- if (static ::$ registeredCommitActions [$ commitAction ] > 0 ) {
108-
109- if ($ this ->getConnection ()->transactionLevel () <= 0 ) {
110-
111- $ this ->fireModelEvent ($ commitAction );
112-
113- } else {
114-
115- TransactionEventsSubscriber::addModelCallback ($ this , function () use ($ commitAction ) {
116-
117- $ this ->fireModelEvent ($ commitAction );
118-
119- });
120-
121- }
122-
107+ if (static ::$ registeredCommitActions [$ commitAction ] <= 0 ) {
108+ return $ this ;
109+ }
110+
111+ if ($ this ->getConnection ()->transactionLevel () <= 0 ) {
112+ $ this ->fireModelEvent ($ commitAction );
113+ return $ this ;
123114 }
124115
125-
116+ TransactionEventsSubscriber::addModelCallback ($ this , function () use ($ commitAction ) {
117+ $ this ->fireModelEvent ($ commitAction );
118+ });
119+
126120 return $ this ;
127121 }
128122
@@ -140,4 +134,4 @@ protected static function nativeEventsToTransactionEvents()
140134 'deleted ' => 'committedDelete ' ,
141135 ];
142136 }
143- }
137+ }
You can’t perform that action at this time.
0 commit comments