$profile = Profile::find()->select('*')->joinWith('user',true,'RIGHT JOIN')->where(['username'=>$login])->one();
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();