Completed
Push — master ( 74c9a9...1153e3 )
by Andrii
11:57 queued 07:40
created

ConfigProfileCombo   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 1
b 0
f 0
dl 0
loc 26
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilter() 0 5 1
1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\widgets\combo;
12
13
use hiqdev\combo\Combo;
14
use yii\helpers\ArrayHelper;
15
16
class ConfigProfileCombo extends Combo
17
{
18
    /** {@inheritdoc} */
19
    public $name = 'profiles';
20
21
    /** {@inheritdoc} */
22
    public $type = 'config/profile';
23
24
    /** {@inheritdoc} */
25
    public $url = '/server/config-profile/search';
26
27
    /** {@inheritdoc} */
28
    public $_return = ['id', 'name', 'type'];
29
30
    /** {@inheritdoc} */
31
    public $primaryFilter = 'name_like';
32
33
    /** {@inheritdoc} */
34
    public $_rename = ['text' => 'name'];
35
36
    /** {@inheritdoc} */
37
    public function getFilter()
38
    {
39
        return ArrayHelper::merge(parent::getFilter(), [
40
            'type' => ['format' => 'config'],
41
            'limit' => ['format' => '50'],
42
        ]);
43
    }
44
}
45