Exemplo n.º 1
0
 /**
  * @param  UserInterface $user
  * @return array
  */
 public function serialize(UserInterface $user)
 {
     $serialized = ['user_id' => $user->getUserId(), 'email' => $user->getEmail(), 'name' => $user->getName()];
     $signedUpAt = $user->getSignedUpAt();
     if (null !== $signedUpAt) {
         $serialized['signed_up_at'] = $signedUpAt->getTimestamp();
     }
     return $serialized;
 }
Exemplo n.º 2
0
 /**
  * Send an email to a user to confirm the account creation
  *
  * @param UserInterface $user
  *
  * @return void
  */
 public function sendRecoveryPasswordConfirmation($user)
 {
     $templateName = 'CoreBundle:Email:validate.new.password.html.twig';
     $context = array('name' => $user->getName());
     $this->sendMessage($templateName, $context, $this->parameters['company']['email'], $user->getEmail());
 }