Test Failed
Push — master ( 8158be...5430bc )
by Alexey
05:17
created

WalletDiff   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A groupAction() 0 9 3
1
<?php
2
3
/**
4
 * Data manager delete action
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2016 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Money;
13
14
class WalletDiff extends \Ui\DataManager\Action {
15
    public static $name = 'Списать/пополнить';
16
    public static $groupAction = true;
17
18
    public static function groupAction($dataManager, $ids, $actionParams, $adInfo) {
19
        if (empty($adInfo['amount'])) {
20
            throw new \Exception('Необходимо указать сумму');
21
        }
22
        $wallets = Wallet::getList(['where' => ['id', $ids, 'IN']]);
23
        foreach ($wallets as $wallet) {
24
            $wallet->diff($adInfo['amount'], $adInfo['comment']);
25
        }
26
    }
27
28
}
29