From f2c7acb3c065c35a1e75d512d0ce193f1989296f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 8 Dec 2015 09:40:20 +0100 Subject: Allow getting the last insert id without much hassle --- lib/public/db/querybuilder/iquerybuilder.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/public') diff --git a/lib/public/db/querybuilder/iquerybuilder.php b/lib/public/db/querybuilder/iquerybuilder.php index beb922b7feb..e3105cf134e 100644 --- a/lib/public/db/querybuilder/iquerybuilder.php +++ b/lib/public/db/querybuilder/iquerybuilder.php @@ -796,4 +796,12 @@ interface IQueryBuilder { * @since 8.2.0 */ public function createFunction($call); + + /** + * Used to get the id of the last inserted element + * @return int + * @throws \BadMethodCallException When being called before an insert query has been run. + * @since 9.0.0 + */ + public function getLastInsertId(); } -- cgit v1.2.3