From 3dfbf64a6bf71634226502b292eee2ce03aa0e85 Mon Sep 17 00:00:00 2001 From: Jimmy Huynh Date: Sun, 14 Mar 2021 23:43:06 +0100 Subject: =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Renaming=20'tags'=20into=20'catego?= =?UTF-8?q?ries'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jimmy Huynh --- lib/Db/Item.php | 16 ++++++++-------- lib/Fetcher/FeedFetcher.php | 2 +- lib/Migration/Version150302Date20210312231251.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Db/Item.php b/lib/Db/Item.php index a987159f8..f72330c2f 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -64,7 +64,7 @@ class Item extends Entity implements IAPI, \JsonSerializable /** @var bool */ protected $starred = false; /** @var string|null */ - protected $tags; + protected $categories; public function __construct() { @@ -87,7 +87,7 @@ class Item extends Entity implements IAPI, \JsonSerializable $this->addType('fingerprint', 'string'); $this->addType('unread', 'boolean'); $this->addType('starred', 'boolean'); - $this->addType('tags', 'string'); + $this->addType('categories', 'string'); } /** @@ -281,9 +281,9 @@ class Item extends Entity implements IAPI, \JsonSerializable /** * @return null|string */ - public function getTags(): ?string + public function getCategories(): ?string { - return $this->tags; + return $this->categories; } /** @@ -516,11 +516,11 @@ class Item extends Entity implements IAPI, \JsonSerializable return $this; } - public function setTags(string $tags = null): self + public function setCategories(string $categories = null): self { - if ($this->tags !== $tags) { - $this->tags = $tags; - $this->markFieldUpdated('tags'); + if ($this->categories !== $categories) { + $this->categories = $categories; + $this->markFieldUpdated('categories'); } return $this; diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index ea1a188ce..7840c8cfd 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -261,7 +261,7 @@ class FeedFetcher implements IFeedFetcher $categories[] = $this->decodeTwice($category->getLabel()); } if (count($categories) > 0) { - $item->setTags(implode(',', $categories)); + $item->setCategories(implode(',', $categories)); } // Use description from feed if body is not provided (by a scraper) diff --git a/lib/Migration/Version150302Date20210312231251.php b/lib/Migration/Version150302Date20210312231251.php index dddfbc0a9..70595239e 100644 --- a/lib/Migration/Version150302Date20210312231251.php +++ b/lib/Migration/Version150302Date20210312231251.php @@ -34,7 +34,7 @@ class Version150302Date20210312231251 extends SimpleMigrationStep { if ($schema->hasTable('news_items')) { $table = $schema->getTable('news_items'); - $table->addColumn('tags', 'text', [ + $table->addColumn('categories', 'text', [ 'notnull' => false ]); } -- cgit v1.2.3