Generate a not used id.

@return int
336272
public static function generateId()
    {
        while ($rand = rand(1, PHP_INT_MAX)) {
            if (!in_array($rand, static::$generatedIds, true)) {
                static::$generatedIds[] = $rand;
                return $rand;
            }
        }
    }
200397
protected function getUpdateId(): int
    {
        if (!$this->updateId) {
            $data = $this->browse("DirectChildren");
            $this->updateId = $data["UpdateID"];
        }
        return $this->updateId;
    }
914771
public function getID() {
		$parents = $this->getParents();
		$c = count($parents);

		if($c > 0) {
			$id = $parents[0].'-';
			for($i=1; $i<$c; $i++)
				$id .= $parents[$i].'-';
			$id .= $this->name;
			return $id;
		}
		else
			return $this->name;
	}
235543
public function getId()
    {
        $tmp = (array) $this->getHeaderFieldModel($this->getIdField());

        return $this->headers->has($this->getIdField()) ? current($tmp) : $this->id;
    }
1137865
public function getId()
    {
      $decoded = $this->getDecoded();
      return !is_null($decoded)
                ? $decoded->data->{$this->id_field}
                : null;
    }
549321
protected function getCatID()
    {
        $objBannerCatID = \Database::getInstance()->prepare("SELECT 
                                                                MIN(pid) AS ID 
                                                             FROM 
                                                                tl_banner")
                                                  ->execute();
        $objBannerCatID->next();
        if ($objBannerCatID->ID === null)
        {
            return 0;
        }
        else
        {
            return $objBannerCatID->ID;
        }
    }
727985
public static function getNumericId()
    {
        $hashId = self::getId();
        $id = (integer) substr(preg_replace('/[a-z]+/', '', $hashId), 0, 9);
        $letters = preg_replace('/[0-9]+/', '', $hashId);
        for ($i = 0, $length = strlen($letters); $i < $length; $i++) {
            $id += ord($letters[$i]) - 97;
        }
        return $id;
    }
737663
protected function generateTrackingId()
    {
        $ctaRepository = $this->em->getRepository('CampaignChainCoreBundle:CTA');

        // loop until there is a unused id
        while (true) {
            $trackingId = md5(uniqid(mt_rand(), true));

            if (!$ctaRepository->findOneByTrackingId($trackingId)) {
                return $trackingId;
            }
        }
    }
197668
protected function generateConnectionId()
    {
        $max_unsigned_int = 4294967295;
        if (self::$_connectionIdRecorder >= $max_unsigned_int) {
            self::$_connectionIdRecorder = 0;
        }
        while(++self::$_connectionIdRecorder <= $max_unsigned_int) {
            if(!isset($this->_clientConnections[self::$_connectionIdRecorder])) {
                break;
            }
        }
        return self::$_connectionIdRecorder;
    }
330103
public function getId()
    {
        $control = $this->control ? $this->control . '/' : '';

        return 'input-' . preg_replace('/[^A-Z0-9_]+/i', '-', $control . $this->getName(true));
    }
454143
public function getUid()
    {
        if (is_null($this->uid)) {
            $pathName = (! empty($this->getFileInfo()->getRelativePathname())) ? $this->getFileInfo()->getRelativePathname() : $this->getFileInfo()->getPathname();
            $this->uid = $this->cleanUid($pathName);
        }

        return $this->uid;
    }
1130497
public function getId()
    {
        if (isset($this->ids[$this->namespace])) {
            return $this->ids[$this->namespace];
        } else {
            return (int) $this->getRecord()->get('id');
        }
    }
321838
protected function generateId()
    {
        $inputId = static::$idPrefix . $this->getName();
        if ($this->isMultiple()) {
            $inputId = "{$inputId}-{$this->instances}";
        }
        $this->setAttribute('id', $inputId);
        return $inputId;
    }
1324814
public function getId()
    {
        $col = $this->getIDField();

        if (property_exists($this, $col)) {
            $id = $this->$col;
            if ($id > 0) {
                return $id;
            }
        }
        return false;
    }
1165909
protected function generateIdentifier()
    {
        if ($this->identifier === null) {
            ++self::$nextIdentifier;
            self::$nextIdentifier &= 0xFFFF;

            $this->identifier = self::$nextIdentifier;
        }

        return $this->identifier;
    }
727890
private function _generateUniqueId()
    {
        $rand = uniqid(rand(10, 99));
        $time = microtime(true);
        $micro = sprintf('%06d', ($time - floor($time)) * 1000000);
        $date = new DateTime(date('Y-m-d H:i:s.' . $micro, $time));
        return sha1($date->format('YmdHisu'));
    }
272465
public function generateId()
    {
        $data = openssl_random_pseudo_bytes(16);
        $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
        $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10

        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
    }