Completed
Push — master ( 6a485a...18c4f3 )
by Andrii
04:57
created

ObjLabelWidget::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 5
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-2016, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\widgets\obj;
12
13
use hipanel\models\Obj;
14
use hipanel\widgets\Label;
15
use Yii;
16
17
class ObjLabelWidget extends Label
18
{
19
    /**
20
     * @var Obj
21
     */
22
    public $model;
23
24
    public function init()
25
    {
26
        $objClass = $this->model->getObjClass();
27
        $this->setColor($objClass->getColor());
28
        $this->setLabel($objClass->getLabel());
29
        parent::init();
30
    }
31
}
32