コード例 #1
0
 /**
  * @param \Likedimion\Database\Entity\Account $account
  * @param \DateTime $endDate
  * @return Token
  */
 public function generateToken(Account $account, \DateTime $endDate)
 {
     $tokenValue = $account->getLogin() . "_" . $account->getPassword() . "_" . rand(0, 99999999999);
     $token = new Token();
     $token->setValue(md5($tokenValue));
     $token->setEndDate($endDate);
     $this->getRepository()->save($token);
     return $token;
 }
 /**
  * {@inheritDoc}
  */
 public function getPassword()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPassword', array());
     return parent::getPassword();
 }