Completed
Push — master ( f708f1...55490a )
by Dmitry
10s
created

TariffCombo   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilter() 0 7 1
1
<?php
2
3
/*
4
 * Stock Module for Hipanel
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-stock
7
 * @package   hipanel-module-stock
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\finance\widgets\combo;
13
14
use hiqdev\combo\Combo;
15
use yii\helpers\ArrayHelper;
16
17
class TariffCombo extends Combo
18
{
19
    /** {@inheritdoc} */
20
    public $type = 'tariff/name';
21
22
    /** {@inheritdoc} */
23
    public $name = 'tariff';
24
25
    /** {@inheritdoc} */
26
    public $url = '/finance/tariff/search';
27
28
    /** {@inheritdoc} */
29
    public $_return = ['id'];
30
31
    /** {@inheritdoc} */
32
    public $_rename = ['text' => 'tariff'];
33
34
    public $_primaryFilter = 'tariff_ilike';
35
36
    public $client = '';
37
38
    /**
39
     * @var string the type of tariff
40
     * @see getFilter()
41
     */
42
    public $tariffType;
43
44
    /** {@inheritdoc} */
45
    public function getFilter()
46
    {
47
        return ArrayHelper::merge(parent::getFilter(), [
48
            'type' => ['format' => $this->tariffType],
49
            'client' => ['format' => $this->client],
50
        ]);
51
    }
52
}
53