summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-08 13:51:25 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-08 13:51:25 +0100
commit85409b6701ffd46806f4a53b69dce0fa6a09d2a9 (patch)
tree1a92be5296d9f947d38e01caec196af1d370fb9f /lib
parentfe8dc0bd5e867831a70251fb8604e1a397f2901b (diff)
parent316b907a13fcca9781f09b0f1a2a2d7324e42770 (diff)
downloadnextcloud-server-85409b6701ffd46806f4a53b69dce0fa6a09d2a9.tar.gz
nextcloud-server-85409b6701ffd46806f4a53b69dce0fa6a09d2a9.zip
Merge pull request #20786 from owncloud/systemtags-dav
DAV endpoint for system tags
Diffstat (limited to 'lib')
-rw-r--r--lib/private/systemtag/systemtagmanager.php4
-rw-r--r--lib/private/systemtag/systemtagobjectmapper.php6
-rw-r--r--lib/public/systemtag/isystemtagmanager.php2
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/systemtag/systemtagmanager.php b/lib/private/systemtag/systemtagmanager.php
index 8caf10d69da..7f239dc84cf 100644
--- a/lib/private/systemtag/systemtagmanager.php
+++ b/lib/private/systemtag/systemtagmanager.php
@@ -63,7 +63,7 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function getTagsById($tagIds) {
+ public function getTagsByIds($tagIds) {
if (!is_array($tagIds)) {
$tagIds = [$tagIds];
}
@@ -242,7 +242,7 @@ class SystemTagManager implements ISystemTagManager {
$tagNotFoundException = null;
try {
- $this->getTagsById($tagIds);
+ $this->getTagsByIds($tagIds);
} catch (TagNotFoundException $e) {
$tagNotFoundException = $e;
}
diff --git a/lib/private/systemtag/systemtagobjectmapper.php b/lib/private/systemtag/systemtagobjectmapper.php
index 75f2631a010..988fa66d77e 100644
--- a/lib/private/systemtag/systemtagobjectmapper.php
+++ b/lib/private/systemtag/systemtagobjectmapper.php
@@ -171,6 +171,10 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
public function haveTag($objIds, $objectType, $tagId, $all = true) {
$this->assertTagsExist([$tagId]);
+ if (!is_array($objIds)) {
+ $objIds = [$objIds];
+ }
+
$query = $this->connection->getQueryBuilder();
if (!$all) {
@@ -209,7 +213,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
* @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist
*/
private function assertTagsExist($tagIds) {
- $tags = $this->tagManager->getTagsById($tagIds);
+ $tags = $this->tagManager->getTagsByIds($tagIds);
if (count($tags) !== count($tagIds)) {
// at least one tag missing, bail out
$foundTagIds = array_map(
diff --git a/lib/public/systemtag/isystemtagmanager.php b/lib/public/systemtag/isystemtagmanager.php
index 4e3b263e56c..6e8fed36dce 100644
--- a/lib/public/systemtag/isystemtagmanager.php
+++ b/lib/public/systemtag/isystemtagmanager.php
@@ -41,7 +41,7 @@ interface ISystemTagManager {
*
* @since 9.0.0
*/
- public function getTagsById($tagIds);
+ public function getTagsByIds($tagIds);
/**
* Returns the tag object matching the given attributes.