public function getRelationLabel($activeRelation, $relation)
    {
        $modelClass = $activeRelation->modelClass;
        if (isset($this->cachedRelationLabels[$modelClass][$relation])) {
            return $this->cachedRelationLabels[$modelClass][$relation];
        }
        if (isset($this->relationLabels[$relation])) {
            $label = $this->relationLabels[$relation];
        } else {
            /** @var ActiveRecord $relationModel */
            $relationModel = new $modelClass;
            $label = $relationModel->getCrudLabel($activeRelation->multiple ? 'relation' : 'default');
        }
        return $this->cachedRelationLabels[$modelClass][$relation] = $label;
    }
public function getRelationLabel($activeRelation, $relation)
    {
        $modelClass = $activeRelation->modelClass;
        if (isset($this->cachedRelationLabels[$modelClass][$relation])) {
            return $this->cachedRelationLabels[$modelClass][$relation];
        }
        if (isset($this->relationLabels[$relation])) {
            $label = $this->relationLabels[$relation];
        } else {
            /** @var ActiveRecord $relationModel */
            $relationModel = new $modelClass;
            $label = $relationModel->getCrudLabel($activeRelation->multiple ? 'relation' : 'default');
        }
        return $this->cachedRelationLabels[$modelClass][$relation] = $label;
    }
public function getRelationLabel ( $ activeRelation , $ relation ) { $ modelClass = $ activeRelation -> modelClass ; if ( isset ( $ this -> cachedRelationLabels [ $ modelClass ] [ $ relation ] ) ) { return $ this -> cachedRelationLabels [ $ modelClass ] [ $ relation ] ; } if ( isset ( $ this -> relationLabels [ $ relation ] ) ) { $ label = $ this -> relationLabels [ $ relation ] ; } else { /** @var ActiveRecord $relationModel */ $ relationModel = new $ modelClass ; $ label = $ relationModel -> getCrudLabel ( $ activeRelation -> multiple ? 'relation' : 'default' ) ; } return $ this -> cachedRelationLabels [ $ modelClass ] [ $ relation ] = $ label ; }
Fetches translated label from the relationLabels property or relation model.
@param \yii\db\ActiveQuery $activeRelation
@param string $relation
@return string
Fetches translated label from the relationLabels property or relation model .