summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-03-12 18:44:16 +0100
committerGitHub <noreply@github.com>2018-03-12 18:44:16 +0100
commitfac0a11576874e25141e34749e7bc64a688b2506 (patch)
treefe30052a2a6c01794f15c7c934bd23ff946028e9 /lib/private
parent3655951dd7372be9193e9ddd6f4b717f8d2cc6b4 (diff)
parent2b335fd607e15c9955d6d42f50c460f04f7fe445 (diff)
downloadnextcloud-server-fac0a11576874e25141e34749e7bc64a688b2506.tar.gz
nextcloud-server-fac0a11576874e25141e34749e7bc64a688b2506.zip
Merge pull request #8786 from nextcloud/remove-insert-if-not-exists
Use insertIfNotExist of the new interface
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Tags.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Tags.php b/lib/private/Tags.php
index cc7bbf01ab4..2bc5572c40f 100644
--- a/lib/private/Tags.php
+++ b/lib/private/Tags.php
@@ -491,12 +491,13 @@ class Tags implements \OCP\ITags {
$tags = $this->tags;
// For some reason this is needed or array_search(i) will return 0..?
ksort($tags);
+ $dbConnection = \OC::$server->getDatabaseConnection();
foreach(self::$relations as $relation) {
$tagId = $this->getTagId($relation['tag']);
\OCP\Util::writeLog('core', __METHOD__ . 'catid, ' . $relation['tag'] . ' ' . $tagId, \OCP\Util::DEBUG);
if($tagId) {
try {
- \OCP\DB::insertIfNotExist(self::RELATION_TABLE,
+ $dbConnection->insertIfNotExist(self::RELATION_TABLE,
array(
'objid' => $relation['objid'],
'categoryid' => $tagId,
@@ -679,7 +680,7 @@ class Tags implements \OCP\ITags {
$tagId = $tag;
}
try {
- \OCP\DB::insertIfNotExist(self::RELATION_TABLE,
+ \OC::$server->getDatabaseConnection()->insertIfNotExist(self::RELATION_TABLE,
array(
'objid' => $objid,
'categoryid' => $tagId,