Completed
Pull Request — master (#55)
by
unknown
04:43
created

PrepareBulkAction::getDataProvider()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 10
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
        $this->dataProvider->query->andWhere(['limit' => $limit ?: 'ALL']);
0 ignored issues
show
Bug introduced by
The variable $limit does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
33
34
        return $this->dataProvider;
35
    }
36
}
37