Beispiel #1
0
 public function generatePasswordResetToken(User $user)
 {
     $user->setConfirmationToken($token = User::generateToken());
     $this->sendResetPasswordMail($user->getEmail(), $token);
     $this->entityManager->persist($user);
     $this->entityManager->flush();
 }
Beispiel #2
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct(null);
     $this->roles = new ArrayCollection();
     $this->name = null;
     $this->deleted = false;
     $this->advertisments = new ArrayCollection();
     $this->rating = 0;
     $this->votesCount = 0;
     $this->votes = [];
     $this->orders = [];
     $this->payments = [];
     if ($this->avatar === null) {
         $this->avatar = '/css/img/icon-user-default.png';
     }
     $this->salt = User::generateToken();
     $this->language = 'ua';
 }