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

PrepareBulkAction::getDataProvider()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 0
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
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