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