src/traits/ListData.php
public static function getNameById($id, $attributeName = 'name')
    {
        $model = static::loadModel($id);
        return empty($model[$attributeName]) === false ? $model[$attributeName] : \Yii::t('app', 'Unknown');
    }
public static function getNameById($id, $attributeName = 'name')
    {
        $model = static::loadModel($id);
        return empty($model[$attributeName]) === false ? $model[$attributeName] : \Yii::t('app', 'Unknown');
    }
Get the record name by id.
@param integer $id
@param string $attributeName
@return string