public function create($userId): EzUserAccountKey
    {
        $this->removeByUserId($userId);

        $randomBytes = false;

        if (function_exists('openssl_random_pseudo_bytes')) {
            $randomBytes = openssl_random_pseudo_bytes(32);
        }

        if ($randomBytes === false) {
            $randomBytes = mt_rand();
        }

        $hash = md5($userId . ':' . microtime() . ':' . $randomBytes);

        $userAccount = new EzUserAccountKey();
        $userAccount->setHash($hash);
        $userAccount->setTime(time());
        $userAccount->setUserId($userId);

        $this->getEntityManager()->persist($userAccount);
        $this->getEntityManager()->flush();

        return $userAccount;
    }