Skip to content

Instantly share code, notes, and snippets.

@ppeiris
Created November 2, 2013 19:46
Show Gist options
  • Save ppeiris/7282759 to your computer and use it in GitHub Desktop.
Save ppeiris/7282759 to your computer and use it in GitHub Desktop.
private function setResetToken($accountid) {
try {
$token = uniqid().uniqid(); /** Generate a unique token */
$tAccounts = new \Entity\Tables\tAccounts();
$newReset = new \Entity\Tables\tAccountPasswordReset();
$newReset->setTAccount($tAccounts);
$newReset->accountId = $accountid;
$newReset->resetToken = $token;
$this->entityManager->persist($newReset);
$this->entityManager->flush();
return $token;
} catch (Exception $e) {
throw $e;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment