Esempio n. 1
0
 /**
  * @param tokenModel $tokenModel
  *
  * @return string
  * @throws tokenManagerException
  */
 public function generateToken($tokenModel)
 {
     $tokenString = $this->encode($tokenModel->minify());
     $tokenModel->setToken($tokenString);
     try {
         $tokenModel->getMapper()->save($tokenModel);
     } catch (\Exception $e) {
         throw new tokenManagerException('Unable to generate token, because sub exception was caught', 0, $e);
     }
     return $tokenString;
 }