/** * @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 setEndDate($endDate) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setEndDate', array($endDate)); return parent::setEndDate($endDate); }