summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-13 08:15:06 +0200
committerGitHub <noreply@github.com>2020-08-13 08:15:06 +0200
commit3c5692244448bd095e6ad3df3859032c6fb62a8d (patch)
treecf05f365c427a01b69823c0c25892841c0026665 /lib/private
parent725fecee3454dd1fabe1b373a8c9a37f81040fd9 (diff)
parent5f58cefbd7898ebc07da7a80b75c98e4350d0cb5 (diff)
downloadnextcloud-server-3c5692244448bd095e6ad3df3859032c6fb62a8d.tar.gz
nextcloud-server-3c5692244448bd095e6ad3df3859032c6fb62a8d.zip
Merge pull request #22205 from nextcloud/activity-settings-cleanup
merge file activity settings into a single 'favorite changed' item
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Tags.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/Tags.php b/lib/private/Tags.php
index 3fc66c69d6c..22c6c68ba6c 100644
--- a/lib/private/Tags.php
+++ b/lib/private/Tags.php
@@ -642,6 +642,23 @@ class Tags implements ITags {
}
/**
+ * Get all users who favorited an object
+ */
+ public function getUsersFavoritingObject($objId) {
+ $entries = [];
+
+ $query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+ $query->select('uid')
+ ->from('vcategory_to_object', 'o')
+ ->innerJoin('o', 'vcategory', 'c', $query->expr()->eq('o.categoryid', 'c.id'))
+ ->where($query->expr()->eq('objid', $query->createNamedParameter($objId, IQueryBuilder::PARAM_INT)))
+ ->andWhere($query->expr()->eq('c.type', $query->createNamedParameter($this->type)))
+ ->andWhere($query->expr()->eq('c.category', $query->createNamedParameter(ITags::TAG_FAVORITE)));
+
+ return $query->execute()->fetchAll(\PDO::FETCH_COLUMN);
+ }
+
+ /**
* Creates a tag/object relation.
*
* @param int $objid The id of the object