Last active
December 27, 2015 09:59
-
-
Save ppeiris/7307713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$account = $this->entityManager->getRepository('\Entity\Tables\tAccounts'); | |
/** Find the account from tAccounts table */ | |
$record = $account->findOneBy(array('userEmail' => $email)); | |
if ($record) { // There is an active account for given email. | |
/** Generate a unique token */ | |
$token = uniqid().uniqid(); | |
/** create a new tAccountPasswordReset object and fill the info */ | |
$newReset = new \Entity\Tables\tAccountPasswordReset(); | |
$newReset->resetToken = $token; | |
/** | |
* addReset() is define the the tAccounts Entity | |
*/ | |
$record->addReset($newReset); | |
$this->entityManager->flush(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment