PriceSearch::searchAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 0
cts 10
cp 0
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\models;
12
13
use hipanel\base\SearchModelTrait;
14
use Yii;
15
16 View Code Duplication
class PriceSearch extends Price
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    use SearchModelTrait {
19
        searchAttributes as defaultSearchAttributes;
20
    }
21
22
    protected function searchAttributes()
23
    {
24
        return array_merge(self::defaultSearchAttributes(), [
25
            'object_name_ilike',
26
            'buyer_ilike',
27
            'plan_owner_ilike',
28
            'model_group_name_ilike',
29
            'model_partno_ilike',
30
        ]);
31
    }
32
33
    public function attributeLabels()
34
    {
35
        return array_merge(parent::attributeLabels(), [
36
            'currency_in' => Yii::t('hipanel', 'Currency'),
37
            'object_name_ilike' => Yii::t('hipanel.finance.price', 'Object name'),
38
            'plan_name_ilike' => Yii::t('hipanel.finance.price', 'Tariff plan name'),
39
            'buyer_ilike' => Yii::t('hipanel.finance.price', 'Tariff plan buyer'),
40
            'plan_owner_ilike' => Yii::t('hipanel.finance.price', 'Tariff plan owner'),
41
            'model_group_name_ilike' => Yii::t('hipanel.finance.price', 'Group model name'),
42
            'model_partno_ilike' => Yii::t('hipanel.finance.price', 'Model partno'),
43
        ]);
44
    }
45
}
46