/** * @param User $user * @param string $token * @param string $userAgent * @param string $ip4 * @return self */ public static function createResetPasswordToken(User $user, $token, $userAgent, $ip4) { $expires = new DateTime('+1 hour'); $userToken = new self($user, UserTokenType::internal(), $token, $userAgent, $ip4, $expires); $userToken->raise(new ResetPasswordEvent($user->getId(), $user->getEmail(), $user->getFullName(), $token)); return $userToken; }
protected function preBuild() { $this->entityDTO->isInternal = $this->entity->isInternal(); $this->entityDTO->isGoogle = $this->entity->isGoogle(); $this->entityDTO->isFacebook = $this->entity->isFacebook(); $this->entityDTO->isTwitter = $this->entity->isTwitter(); $this->entityDTO->isYahoo = $this->entity->isYahoo(); }
public function getUserTokenType() { return UserTokenType::internal(); }
public function testCreateByIdThrowsExceptionWhenInvalid() { $this->setExpectedException(InvalidArgumentException::class); UserTokenType::createById(999); }