Completed
Push — master ( 3bd96a...d26825 )
by Klochok
12:58
created

FamilyColumn::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Hosting Plugin for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-hosting
6
 * @package   hipanel-module-hosting
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\hosting\grid;
12
13
use hiqdev\higrid\DataColumn;
14
use Yii;
15
use yii\bootstrap\Progress;
16
use yii\helpers\IpHelper;
17
18
class FamilyColumn extends DataColumn
19
{
20
    public function init()
21
    {
22
        parent::init();
23
        $this->label = Yii::t('hipanel.hosting.ipam', 'Family');
24
    }
25
26
    public function getDataCellValue($model, $key, $index)
27
    {
28
        return sprintf('IPv%d', IpHelper::getIpVersion($model->ip));
29
    }
30
}
31