How can I use postsave method extending WebformHandlerBase for submitting to account fields I created a webform handler class extending from WebFormHandlerBase: The method, postsave has the following code:

public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
    $account = \Drupal::currentUser();
    $user = \Drupal\user\Entity\User::load($account-&gt;id());
    $user-&gt;addRole('example');
    $user-&gt;save();
  }


A boolean and photo value are submitted by the webform submission.  I need to submit the boolean and photo to account fields.  How do I do it?
$account = \Drupal::currentUser();
    $user = \Drupal\user\Entity\User::load($account->id());
    $data = $webform_submission->getData();
    $photo = $data['picture'];
    $user->set('field_photo', $photo);
    $user->save();
  }
The above code, for example, will take a webform element, key is 'picture' and set it to an account field, 'field_photo'.