You are here

protected function UserCreate::afterUserSave in Apigee Edge 8

Execute actions after the user has been saved.

Actions here always gets executed even if the user save has failed.

Parameters

\Drupal\apigee_edge\Structure\DeveloperToUserConversionResult $result: Result of the entity conversion.

Overrides UserCreateUpdate::afterUserSave

File

src/Job/UserCreate.php, line 32

Class

UserCreate
A job to create a Drupal user from an Apigee Edge developer.

Namespace

Drupal\apigee_edge\Job

Code

protected function afterUserSave(DeveloperToUserConversionResult $result) : void {
  $context = [];

  // If user could be saved.
  if ($result
    ->getUser()
    ->id()) {
    $context['link'] = $result
      ->getUser()
      ->toLink(t('View user'))
      ->toString();
  }

  // Only log problems after a user has been saved because this way we can
  // provide an link to its profile page in log entries.
  $this
    ->logConversionProblems($result
    ->getProblems(), $context);
  parent::afterUserSave($result);
}