src/models/Consumption.php
public function getTypeLabel(): string
    {
        $provider = Yii::createObject(BillTypesProvider::class);
        $types = ArrayHelper::index($provider->getTypes(), 'name');
        if (!isset($types[$this->type])) {
            return '--';
        }

        return $types[$this->type]->label;
    }
public function getTypeLabel(): string
    {
        $provider = Yii::createObject(BillTypesProvider::class);
        $types = ArrayHelper::index($provider->getTypes(), 'name');
        if (!isset($types[$this->type])) {
            return '--';
        }

        return $types[$this->type]->label;
    }
public function getTypeLabel ( ) : string { $ provider = Yii :: createObject ( BillTypesProvider :: class ) ; $ types = ArrayHelper :: index ( $ provider -> getTypes ( ) , 'name' ) ; if ( ! isset ( $ types [ $ this -> type ] ) ) { return '--' ; } return $ types [ $ this -> type ] -> label ; }
Get type label.
@throws \yii\base\InvalidConfigException
@return string
Get type label .