public function getProfile() {
return $this->hasOne(Profile::class,['id'=>'id']);
}
$user = User::find()->andWhere(['username'=>$login])->one();
$user->name; // своятво пользователя
$user->profile->id // свойство профиля
$user = User::find()->with('profile')->andWhere(['username'=>$login])->one();