获得下一个ID (该方法是线程安全的)
@return int
@throws Exception
771964
public function next():int
    {
        $timestamp = $this->milliTime();
        if ($timestamp < $this->_lastTimestamp) {
            throw new Exception(sprintf("Clock moved backwards.  Refusing to generate id for %d milliseconds", $this->_lastTimestamp - $timestamp));
        }
        if ($this->_lastTimestamp == $timestamp) {
            $this->_sequence = ($this->_sequence + 1) & self::SEQUENCE_MASK;
            if ($this->_sequence == 0) {
                $timestamp = $this->waitNextMilli($this->_lastTimestamp);
            }
        } else {
            $this->_sequence = 0;
        }
        $this->_lastTimestamp = $timestamp;
        return (($timestamp - $this->epoch) << self::TIMESTAMP_LEFT_SHIFT)
            | ($this->dataCenterId << self::DATA_CENTER_ID_SHIFT)
            | ($this->workerId << self::WORKER_ID_SHIFT)
            | $this->_sequence;
    }
1325466
public function getCurrentId()
    {
        $sql   = 'SELECT value FROM ' . $this->table . ' WHERE name = ?';

        $id = $this->db->fetchOne($sql, array($this->name));

        if (!empty($id) || '0' === $id || 0 === $id) {
            return (int) $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;
    }
629888
public function getID()
    {
        $idAttribute = $this->idAttribute;
        return (is_string($idAttribute) && !empty($idAttribute)) ? $this->$idAttribute : null;
    }
489096
private function getId()
    {
        $id = $this->id;

        if ($this->parent->id !== null) {
            $id = $this->parent->id . '_' . $id;
        }

        return $id;
    }
123802
public function getType() : int
    {
        $query = 'SELECT type_id FROM info LIMIT 1';

        $typeId = Type::UNKNOWN;
        foreach ($this->getAdapter()->query($query) as $row) {
            $typeId = (int)$row['type_id'];
        }

        return $typeId;
    }
569848
public function newId() {
        $ids = [];
        $cnt = $this->count();
        if ($cnt === false) {
            if ($this->exception instanceof \PDOException) {
                $this->error = $this->exception->getMessage();
            }
            log_error($this->error . '[' . $this->getSqlString() . ']', 'sql.err');

            return 0;
        } else if ($this instanceof InsertSQL) {
            $ids = $this->lastInsertIds();
        }

        return $ids ? $ids[0] : 0;
    }
230273
public final function getId(): ?int
    {
        $id = end($this->ids);

        return ($id !== false) ? $id : null;
    }
66341
public function getRouteKey()
    {
        $key = $this->getKey();

        if ($this->getKeyType() === 'int' && (ctype_digit($key) || is_int($key))) {
            return App::make('fakeid')->encode((int) $key);
        }

        throw new RuntimeException('Key should be of type int to encode into a fake id.');
    }
11377
public function getItem()
    {
        if ($this->_item === null) {
            $this->_item = Yii::$app->menu->find()->where(['id' => $this->childOf])->with('hidden')->one();
            
            if (!$this->_item) {
                throw new Exception("Unable to find item with id " . $this->childOf);
            }
        }
        
        return $this->_item;
    }
1239660
public function lastInsertId()
    {
        if ($this->isConnected()) {
            try {
                return $this->pdo->lastInsertId();
            } catch (PDOException $e) {
                throw new \Exception($e->getMessage());
                return false;
            }
        } else {
            return false;
        }
    }
1342315
public function getId() : ?string 
    {
        if ( ! $this->hasId()) {
            $this->setId($this->getDefaultId());
        }
        return $this->id;
    }
846868
public function generateCacheId()
    {
        if (!$this->getCurrentView()) {
            throw new \Exception(sprintf(
                'Cannot generate an hash for widget %s if currentView is not defined.',
                $this->getId()
            ));
        }

        return sprintf(
            '%s-%s-%s',
            $this->getId(),
            $this->getUpdatedAt()->getTimestamp(),
            $this->getCurrentView()->getReference()->getId()
        );
    }
251386
@Override
	public String getId() {
		StringBuilder strId = new StringBuilder();
		strId.append(id);
		if (nextProcessor != null) {
			strId.append(",").append(nextProcessor.getId());
		}
		return strId.toString();
	}
581184
public function getId()
    {
        return sprintf(
          '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
          mt_rand(0, 0x0fff) | 0x4000,
          mt_rand(0, 0x3fff) | 0x8000,
          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
627942
public function getStatus()
    {
        if (isset($this->_statuses[(int) $this->status])) {
            return $this->_statuses[(int) $this->status];
        }
        throw new \Exception('Status "' . $this->status . '" not found for Page with id ' . $this->id . '.');
    }
898658
public function getCurrentRequestId()
    {
        if ($this->requestId === null) {
            $this->requestId = $this->getRequestIdGenerator()->generate();
        }
        return $this->requestId;
    }