Esempio n. 1
0
 public function __construct(User $user)
 {
     $this->setId($user->getId());
     $this->setUsername($user->getUsername());
     $this->setEmail($user->getEmail());
     $this->setApiKey($user->getApiKey());
 }
Esempio n. 2
0
 private function generateApiKey(User $user)
 {
     $apiKey = $user->getId();
     $apiKey .= uniqid(md5($user->getUsername() . time()));
     return $apiKey;
 }