summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-03-12 15:13:37 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-03-12 15:13:37 +0100
commit8195b17ed7aebb5fc6aa900005076040130a8295 (patch)
tree54e342f85285d511551af7acd5bccbd2d7f160fe /lib
parentaf89db3407e599ea47d62a851759fa929cdd4713 (diff)
downloadnextcloud-server-8195b17ed7aebb5fc6aa900005076040130a8295.tar.gz
nextcloud-server-8195b17ed7aebb5fc6aa900005076040130a8295.zip
Remove deprecated and unsused methods of OCP\DB
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Tags.php12
-rw-r--r--lib/public/DB.php37
2 files changed, 6 insertions, 43 deletions
diff --git a/lib/private/Tags.php b/lib/private/Tags.php
index 1b3505da5bd..cc7bbf01ab4 100644
--- a/lib/private/Tags.php
+++ b/lib/private/Tags.php
@@ -236,7 +236,7 @@ class Tags implements \OCP\ITags {
}
$entries[$objId][] = $row['category'];
}
- if (\OCP\DB::isError($result)) {
+ if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
return false;
}
@@ -290,7 +290,7 @@ class Tags implements \OCP\ITags {
try {
$stmt = \OCP\DB::prepare($sql);
$result = $stmt->execute(array($tagId));
- if (\OCP\DB::isError($result)) {
+ if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
return false;
}
@@ -532,7 +532,7 @@ class Tags implements \OCP\ITags {
$stmt = \OCP\DB::prepare('SELECT `id` FROM `' . self::TAG_TABLE . '` '
. 'WHERE `uid` = ?');
$result = $stmt->execute(array($arguments['uid']));
- if (\OCP\DB::isError($result)) {
+ if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
}
} catch(\Exception $e) {
@@ -570,7 +570,7 @@ class Tags implements \OCP\ITags {
$stmt = \OCP\DB::prepare('DELETE FROM `' . self::TAG_TABLE . '` '
. 'WHERE `uid` = ?');
$result = $stmt->execute(array($arguments['uid']));
- if (\OCP\DB::isError($result)) {
+ if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
}
} catch(\Exception $e) {
@@ -601,7 +601,7 @@ class Tags implements \OCP\ITags {
$updates[] = $this->type;
$stmt = \OCP\DB::prepare($query);
$result = $stmt->execute($updates);
- if (\OCP\DB::isError($result)) {
+ if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
return false;
}
@@ -770,7 +770,7 @@ class Tags implements \OCP\ITags {
. 'WHERE `categoryid` = ?';
$stmt = \OCP\DB::prepare($sql);
$result = $stmt->execute(array($id));
- if (\OCP\DB::isError($result)) {
+ if ($result === null) {
\OCP\Util::writeLog('core',
__METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(),
\OCP\Util::ERROR);
diff --git a/lib/public/DB.php b/lib/public/DB.php
index e132c5ff2ec..f62f718029d 100644
--- a/lib/public/DB.php
+++ b/lib/public/DB.php
@@ -79,22 +79,6 @@ class DB {
}
/**
- * Gets last value of autoincrement
- * @param string $table The optional table name (will replace *PREFIX*) and add sequence suffix
- * @return string
- *
- * \Doctrine\DBAL\Connection lastInsertID()
- *
- * Call this method right after the insert command or other functions may
- * cause trouble!
- * @deprecated 8.1.0 use lastInsertId() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection()
- * @since 4.5.0
- */
- public static function insertid($table=null) {
- return (string)\OC::$server->getDatabaseConnection()->lastInsertId($table);
- }
-
- /**
* Start a transaction
* @deprecated 8.1.0 use beginTransaction() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection()
* @since 4.5.0
@@ -113,27 +97,6 @@ class DB {
}
/**
- * Rollback the database changes done during a transaction that is in progress
- * @deprecated 8.1.0 use rollback() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection()
- * @since 8.0.0
- */
- public static function rollback() {
- \OC::$server->getDatabaseConnection()->rollBack();
- }
-
- /**
- * Check if a result is an error, works with Doctrine
- * @param mixed $result
- * @return bool
- * @deprecated 8.1.0 Doctrine returns false on error (and throws an exception)
- * @since 4.5.0
- */
- public static function isError($result) {
- // Doctrine returns false on error (and throws an exception)
- return $result === false;
- }
-
- /**
* returns the error code and message as a string for logging
* works with DoctrineException
* @return string