summaryrefslogtreecommitdiffstats
path: root/lib/public/db.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/db.php')
-rw-r--r--lib/public/db.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/public/db.php b/lib/public/db.php
index 44afc800abc..9c5f9424dcb 100644
--- a/lib/public/db.php
+++ b/lib/public/db.php
@@ -89,7 +89,7 @@ class DB {
* @since 4.5.0
*/
public static function insertid($table=null) {
- return(\OC_DB::insertid($table));
+ return \OC::$server->getDatabaseConnection()->lastInsertId($table);
}
/**
@@ -98,7 +98,7 @@ class DB {
* @since 4.5.0
*/
public static function beginTransaction() {
- \OC_DB::beginTransaction();
+ \OC::$server->getDatabaseConnection()->beginTransaction();
}
/**
@@ -107,7 +107,7 @@ class DB {
* @since 4.5.0
*/
public static function commit() {
- \OC_DB::commit();
+ \OC::$server->getDatabaseConnection()->commit();
}
/**
@@ -116,7 +116,7 @@ class DB {
* @since 8.0.0
*/
public static function rollback() {
- \OC_DB::rollback();
+ \OC::$server->getDatabaseConnection()->rollback();
}
/**
@@ -127,7 +127,8 @@ class DB {
* @since 4.5.0
*/
public static function isError($result) {
- return(\OC_DB::isError($result));
+ // Doctrine returns false on error (and throws an exception)
+ return $result === false;
}
/**
@@ -138,7 +139,7 @@ class DB {
* @since 6.0.0
*/
public static function getErrorMessage() {
- return(\OC_DB::getErrorMessage());
+ return \OC::$server->getDatabaseConnection()->getError();
}
}