Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/private/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function getTagsForObjects(array $objIds) {
$entries[$objId][] = $row['category'];
}
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), \OCP\Util::ERROR);
return false;
}
}
Expand Down Expand Up @@ -291,7 +291,7 @@ public function getIdsForTag($tag) {
$stmt = \OCP\DB::prepare($sql);
$result = $stmt->execute(array($tagId));
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), \OCP\Util::ERROR);
return false;
}
} catch(\Exception $e) {
Expand Down Expand Up @@ -534,7 +534,7 @@ public static function post_deleteUser($arguments) {
. 'WHERE `uid` = ?');
$result = $stmt->execute(array($arguments['uid']));
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), \OCP\Util::ERROR);
}
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
Expand Down Expand Up @@ -572,7 +572,7 @@ public static function post_deleteUser($arguments) {
. 'WHERE `uid` = ?');
$result = $stmt->execute(array($arguments['uid']));
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OC::$server->getDatabaseConnection()->getError(), \OCP\Util::ERROR);
}
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
Expand Down Expand Up @@ -603,7 +603,7 @@ public function purgeObjects(array $ids) {
$stmt = \OCP\DB::prepare($query);
$result = $stmt->execute($updates);
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), \OCP\Util::ERROR);
return false;
}
} catch(\Exception $e) {
Expand Down Expand Up @@ -773,7 +773,7 @@ public function delete($names) {
$result = $stmt->execute(array($id));
if ($result === null) {
\OCP\Util::writeLog('core',
__METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(),
__METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(),
\OCP\Util::ERROR);
return false;
}
Expand Down
29 changes: 0 additions & 29 deletions lib/public/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,4 @@ static public function prepare( $query, $limit=null, $offset=null ) {
return \OC_DB::prepare($query, $limit, $offset);
}

/**
* Start a transaction
* @deprecated 8.1.0 use beginTransaction() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection()
* @since 4.5.0
*/
public static function beginTransaction() {
\OC::$server->getDatabaseConnection()->beginTransaction();
}

/**
* Commit the database changes done during a transaction that is in progress
* @deprecated 8.1.0 use commit() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection()
* @since 4.5.0
*/
public static function commit() {
\OC::$server->getDatabaseConnection()->commit();
}

/**
* returns the error code and message as a string for logging
* works with DoctrineException
* @return string
* @deprecated 8.1.0 use getError() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection()
* @since 6.0.0
*/
public static function getErrorMessage() {
return \OC::$server->getDatabaseConnection()->getError();
}

}