ObjLabelWidget::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * HiPanel core package
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\widgets\obj;
12
13
use hipanel\models\Obj;
14
use hipanel\widgets\Label;
15
16
class ObjLabelWidget extends Label
17
{
18
    /**
19
     * @var Obj
20
     */
21
    public $model;
22
23
    public function init()
24
    {
25
        $objClass = $this->model->getObjClass();
26
        $this->setColor($objClass->getColor());
27
        $this->setLabel($objClass->getLabel());
28
        parent::init();
29
    }
30
}
31