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

ServerSearch   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 4
dl 0
loc 26
ccs 0
cts 15
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A searchAttributes() 0 9 1
A attributeLabels() 0 6 1
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