yii\db\Schema::getLastInsertID PHP Method

getLastInsertID() public method

Returns the ID of the last inserted row or sequence value.
See also: http://www.php.net/manual/en/function.PDO-lastInsertId.php
public getLastInsertID ( string $sequenceName = '' ) : string
$sequenceName string name of the sequence object (required by some DBMS)
return string the row ID of the last row inserted, or the last value retrieved from the sequence object
    public function getLastInsertID($sequenceName = '')
    {
        if ($this->db->isActive) {
            return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $this->quoteTableName($sequenceName));
        } else {
            throw new InvalidCallException('DB Connection is not active.');
        }
    }