You are here

public function MultiStepStorage::getRetainedAccount in User Merge 2.x

Get retained account.

Return value

\Drupal\user\UserInterface|null Retained account.

Overrides MultiStepStorageInterface::getRetainedAccount

File

src/MultiStepStorage.php, line 115

Class

MultiStepStorage
Class MultiStepStorage.

Namespace

Drupal\usermerge

Code

public function getRetainedAccount() {
  $values = $this->store
    ->get('');
  if (!isset($values['retain'])) {
    return NULL;
  }
  $user = $this->userStorage
    ->load($values['retain']);
  if ($user instanceof UserInterface) {
    return $user;
  }
  return NULL;
}