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

ObjLabelWidget   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 15
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 7 1
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