summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Huynh <jimmy.huynh@etu.unistra.fr>2021-03-14 23:43:06 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-03-17 08:58:42 +0100
commit3dfbf64a6bf71634226502b292eee2ce03aa0e85 (patch)
tree271eaec42765923c22f634be31dda5e0af6b0b83
parentef0742e868cd58e992fd14e7bb42518c12d5c87a (diff)
♻️ Renaming 'tags' into 'categories'
Signed-off-by: Jimmy Huynh <jimmy.huynh@etu.unistra.fr>
-rw-r--r--lib/Db/Item.php16
-rwxr-xr-xlib/Fetcher/FeedFetcher.php2
-rw-r--r--lib/Migration/Version150302Date20210312231251.php2
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
]);
}