diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-02-21 17:47:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-21 17:47:53 +0100 |
commit | dd9d4696f2b50153d9dde297ee9efffd220f1f48 (patch) | |
tree | 36110c4f758a009914827ad4e99f56330809f556 /lib/private | |
parent | b7bfe2b34d154814053450141300b4f97cf0651f (diff) | |
parent | 6235175b6dba4ab416db60a21559a69db2defa83 (diff) | |
download | nextcloud-server-dd9d4696f2b50153d9dde297ee9efffd220f1f48.tar.gz nextcloud-server-dd9d4696f2b50153d9dde297ee9efffd220f1f48.zip |
Merge pull request #19412 from nextcloud/fix/19404/make-favorite-public
Make TAG_FAVORITE public
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Tags.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 0aa37161eb2..fe24391a1a5 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -48,8 +48,9 @@ use OC\Tagging\Tag; use OC\Tagging\TagMapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\ILogger; +use OCP\ITags; -class Tags implements \OCP\ITags { +class Tags implements ITags { /** * Tags @@ -112,8 +113,6 @@ class Tags implements \OCP\ITags { const TAG_TABLE = '*PREFIX*vcategory'; const RELATION_TABLE = '*PREFIX*vcategory_to_object'; - const TAG_FAVORITE = '_$!<Favorite>!$_'; - /** * Constructor. * @@ -186,7 +185,7 @@ class Tags implements \OCP\ITags { $tagMap = array(); foreach($this->tags as $tag) { - if($tag->getName() !== self::TAG_FAVORITE) { + if($tag->getName() !== ITags::TAG_FAVORITE) { $tagMap[] = $this->tagMap($tag); } } @@ -624,12 +623,12 @@ class Tags implements \OCP\ITags { * @return array|false An array of object ids. */ public function getFavorites() { - if(!$this->userHasTag(self::TAG_FAVORITE, $this->user)) { + if(!$this->userHasTag(ITags::TAG_FAVORITE, $this->user)) { return []; } try { - return $this->getIdsForTag(self::TAG_FAVORITE); + return $this->getIdsForTag(ITags::TAG_FAVORITE); } catch(\Exception $e) { \OC::$server->getLogger()->logException($e, [ 'message' => __METHOD__, @@ -647,10 +646,10 @@ class Tags implements \OCP\ITags { * @return boolean */ public function addToFavorites($objid) { - if(!$this->userHasTag(self::TAG_FAVORITE, $this->user)) { - $this->add(self::TAG_FAVORITE); + if(!$this->userHasTag(ITags::TAG_FAVORITE, $this->user)) { + $this->add(ITags::TAG_FAVORITE); } - return $this->tagAs($objid, self::TAG_FAVORITE); + return $this->tagAs($objid, ITags::TAG_FAVORITE); } /** @@ -660,7 +659,7 @@ class Tags implements \OCP\ITags { * @return boolean */ public function removeFromFavorites($objid) { - return $this->unTag($objid, self::TAG_FAVORITE); + return $this->unTag($objid, ITags::TAG_FAVORITE); } /** |