Completed
Push — master ( db4e81...142faa )
by Dmitry
11:56
created

ServerSearch::attributeLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * Server module for HiPanel
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-server
7
 * @package   hipanel-module-server
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\server\models;
13
14
use hipanel\base\SearchModelTrait;
15
use hipanel\helpers\ArrayHelper;
16
use Yii;
17
18
class ServerSearch extends Server
19
{
20
    use SearchModelTrait {
21
        searchAttributes as defaultSearchAttributes;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function searchAttributes()
28
    {
29
        return ArrayHelper::merge($this->defaultSearchAttributes(), [
30
            'name_like',
31
            'with_requests',
32
            'show_deleted',
33
            'with_discounts',
34
        ]);
35
    }
36
37
    public function attributeLabels()
38
    {
39
        return array_merge(parent::attributeLabels(), [
40
            'rack_like' => Yii::t('hipanel/server', 'Rack')
41
        ]);
42
    }
43
}
44