CodeExplorer getUserRecovery example
return null;
} public function getResetUrl(): string
{ return $this->resetUrl;
} public function getUserId(): string
{ return $this->
getUserRecovery()->
getId();
}} if (!
$user) { return;
} $userId =
$user->
getId();
$userIdCriteria =
new Criteria();
$userIdCriteria->
addFilter(new EqualsFilter('userId',
$userId));
$userIdCriteria->
addAssociation('user'
);
if ($existingRecovery =
$this->
getUserRecovery($userIdCriteria,
$context)) { $this->
deleteRecoveryForUser($existingRecovery,
$context);
} $recoveryData =
[ 'userId' =>
$userId,
'hash' => Random::
getAlphanumericString(32
),
];
$this->userRecoveryRepo->
create([$recoveryData],
$context);
$recovery =
$this->
getUserRecovery($userIdCriteria,
$context);