framework/db/Schema.php
public function getLastInsertID($sequenceName = '')
    {
        if ($this->db->isActive) {
            return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $this->quoteTableName($sequenceName));
        }

        throw new InvalidCallException('DB Connection is not active.');
    }
public function getLastInsertID($sequenceName = '')
    {
        if ($this->db->isActive) {
            return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $this->quoteTableName($sequenceName));
        }

        throw new InvalidCallException('DB Connection is not active.');
    }
Returns the ID of the last inserted row or sequence value.
@param string $sequenceName 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
@throws InvalidCallException if the DB connection is not active
@see https://secure.php.net/manual/en/function.PDO-lastInsertId.php