diff options
author | Robin Appelman <robin@icewind.nl> | 2020-08-12 01:43:12 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-08-13 00:01:34 +0200 |
commit | 5f58cefbd7898ebc07da7a80b75c98e4350d0cb5 (patch) | |
tree | ad13ea82f7340ce7e6c9763c4bd9275529d6efff /lib | |
parent | a11769e0e33ab5a33d1f33868f556abb6c2b5dbe (diff) | |
download | nextcloud-server-5f58cefbd7898ebc07da7a80b75c98e4350d0cb5.tar.gz nextcloud-server-5f58cefbd7898ebc07da7a80b75c98e4350d0cb5.zip |
merge file activity settings into a single 'favorite changed' item
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Tags.php | 17 |
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 |