Dibi\Connection::getInsertId PHP Method

getInsertId() public method

Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
public getInsertId ( $sequence = NULL ) : integer
return integer
    public function getInsertId($sequence = NULL)
    {
        $this->connected || $this->connect();
        $id = $this->driver->getInsertId($sequence);
        if ($id < 1) {
            throw new Exception('Cannot retrieve last generated ID.');
        }
        return (int) $id;
    }