diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-04-19 00:29:09 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-04-19 00:29:09 +0200 |
commit | 9b8ebdadf7e12fdaaab03d583602341a6a0210aa (patch) | |
tree | 499cd6fca699d295beaf10d6b1be89e34df01b5b /lib/public/db.php | |
parent | cdf82909b8225a885fbf92b78208fb1fe258853e (diff) | |
download | nextcloud-server-9b8ebdadf7e12fdaaab03d583602341a6a0210aa.tar.gz nextcloud-server-9b8ebdadf7e12fdaaab03d583602341a6a0210aa.zip |
Reduce call of legacy wrapper by call the OCP directly
* ref #15734
* reduces the call depth, because the private methods just call OCP stuff
Diffstat (limited to 'lib/public/db.php')
-rw-r--r-- | lib/public/db.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/public/db.php b/lib/public/db.php index c188352d77b..6e6c5222ec4 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -85,7 +85,7 @@ class DB { * @since 4.5.0 */ public static function insertid($table=null) { - return(\OC_DB::insertid($table)); + return \OC::$server->getDatabaseConnection()->lastInsertId($table); } /** @@ -93,7 +93,7 @@ class DB { * @since 4.5.0 */ public static function beginTransaction() { - \OC_DB::beginTransaction(); + \OC::$server->getDatabaseConnection()->beginTransaction(); } /** @@ -101,7 +101,7 @@ class DB { * @since 4.5.0 */ public static function commit() { - \OC_DB::commit(); + \OC::$server->getDatabaseConnection()->commit(); } /** @@ -109,7 +109,7 @@ class DB { * @since 8.0.0 */ public static function rollback() { - \OC_DB::rollback(); + \OC::$server->getDatabaseConnection()->rollback(); } /** @@ -119,7 +119,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; } /** @@ -129,7 +130,7 @@ class DB { * @since 6.0.0 */ public static function getErrorMessage() { - return(\OC_DB::getErrorMessage()); + return \OC::$server->getDatabaseConnection()->getError(); } } |