@@ -186,7 +186,7 @@ public function removePolicy(string $sec, string $ptype, array $rule): void
186
186
*/
187
187
public function removePolicies (string $ sec , string $ ptype , array $ rules ): void
188
188
{
189
- DB :: transaction (function () use ($ sec , $ rules , $ ptype ) {
189
+ $ this -> eloquent -> getConnection ()-> transaction (function () use ($ sec , $ rules , $ ptype ) {
190
190
foreach ($ rules as $ rule ) {
191
191
$ this ->removePolicy ($ sec , $ ptype , $ rule );
192
192
}
@@ -276,7 +276,7 @@ public function updatePolicy(string $sec, string $ptype, array $oldRule, array $
276
276
*/
277
277
public function updatePolicies (string $ sec , string $ ptype , array $ oldRules , array $ newRules ): void
278
278
{
279
- DB :: transaction (function () use ($ sec , $ ptype , $ oldRules , $ newRules ) {
279
+ $ this -> eloquent -> getConnection ()-> transaction (function () use ($ sec , $ ptype , $ oldRules , $ newRules ) {
280
280
foreach ($ oldRules as $ i => $ oldRule ) {
281
281
$ this ->updatePolicy ($ sec , $ ptype , $ oldRule , $ newRules [$ i ]);
282
282
}
@@ -296,7 +296,7 @@ public function updatePolicies(string $sec, string $ptype, array $oldRules, arra
296
296
public function updateFilteredPolicies (string $ sec , string $ ptype , array $ newPolicies , int $ fieldIndex , string ...$ fieldValues ): array
297
297
{
298
298
$ oldRules = [];
299
- DB :: transaction (function () use ($ sec , $ ptype , $ fieldIndex , $ fieldValues , $ newPolicies , &$ oldRules ) {
299
+ $ this -> eloquent -> getConnection ()-> transaction (function () use ($ sec , $ ptype , $ fieldIndex , $ fieldValues , $ newPolicies , &$ oldRules ) {
300
300
$ oldRules = $ this ->_removeFilteredPolicy ($ sec , $ ptype , $ fieldIndex , ...$ fieldValues );
301
301
$ this ->addPolicies ($ sec , $ ptype , $ newPolicies );
302
302
});
0 commit comments