/** * Author List * @return array */ public static function getAuthorList() { $author = User::find()->all(); return ArrayHelper::map($author, 'id', 'username'); }
public function getUserName() { return $this->hasOne(User::className(), ['id' => 'user_id']); }