Completed
Pull Request — master (#55)
by
unknown
06:40
created

PrepareBulkAction::getDataProvider()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 0
cp 0
rs 9.9666
c 0
b 0
f 0
cc 2
nc 1
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
        $limit = $this->dataProvider->query->limit;
34
        $this->dataProvider->query->andWhere(['limit' => $limit ?: 'ALL']);
35
36
        return $this->dataProvider;
37
    }
38
}
39