Completed
Push — master ( 0b29e9...26b5cd )
by Andrii
05:31 queued 03:18
created

PrepareBulkAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 22
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 1
A getDataProvider() 0 10 2
1
<?php
2
/**
3
 * HiPanel core package.
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\actions;
12
13
use Yii;
14
15
/**
16
 * Class PrepareBulkAction.
17
 */
18
class PrepareBulkAction extends PrepareAjaxViewAction
19
{
20
    /** {@inheritdoc} */
21
    public function run($id = null)
22
    {
23
        $this->setId(Yii::$app->request->get('selection', []));
24
25
        return parent::run();
26
    }
27
28
    /** {@inheritdoc} */
29
    public function getDataProvider()
30
    {
31
        parent::getDataProvider();
32
33
        if (empty($this->dataProvider->query->limit)) {
34
            $this->dataProvider->query->limit('ALL');
35
        }
36
37
        return $this->dataProvider;
38
    }
39
}
40