summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2020-10-28 21:33:17 +0100
committerSean Molenaar <sean@seanmolenaar.eu>2020-10-28 23:08:53 +0100
commitec6930da8226b9879eb2d7289af739aa96de43ef (patch)
treed300e14d3cbe24ad332f58c90965e1540f2941b8
parent47104a1971f1c254ade89d9c084e73a446cc8c20 (diff)
DB: stop overloading getID
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
-rw-r--r--AUTHORS.md3
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/Db/Feed.php21
-rw-r--r--lib/Db/Folder.php15
-rw-r--r--lib/Db/Item.php15
-rw-r--r--lib/Migration/MigrateConfig.php18
6 files changed, 16 insertions, 57 deletions
diff --git a/AUTHORS.md b/AUTHORS.md
index fab6e9c07..65abd3e7d 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -1,8 +1,8 @@
# Authors
* [Bernhard Posselt](mailto:dev@bernhard-posselt.com)
* [Alessandro Cosentino](mailto:cosenal@gmail.com)
-* [Robin Appelman](mailto:icewind@owncloud.com)
* [Benjamin Brahmer](mailto:info@b-brahmer.de)
+* [Robin Appelman](mailto:icewind@owncloud.com)
* [Gregor Tätzner](mailto:gregor@freenet.de)
* [Morris Jobke](mailto:hey@morrisjobke.de)
* [Sean Molenaar](mailto:SMillerDev@users.noreply.github.com)
@@ -43,6 +43,7 @@
* [Andreas Fischer](mailto:bantu@owncloud.com)
* [David Guillot](mailto:david@guillot.me)
* [Gioele Falcetti](mailto:thegio.f@gmail.com)
+* [Igor Bubelov](mailto:igor@bubelov.com)
* [Jan C. Borchardt](mailto:hey@jancborchardt.net)
* [John Kristensen](mailto:john@jerrykan.com)
* [Konrad Graefe](mailto:konradgraefe@aol.com)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f8a09e372..cc0850b38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
## Unreleased
- Added changelog enforcer action
+- Stop overloading DB ids
## 15.0.6
diff --git a/lib/Db/Feed.php b/lib/Db/Feed.php
index 80d425117..852de4c78 100644
--- a/lib/Db/Feed.php
+++ b/lib/Db/Feed.php
@@ -184,14 +184,6 @@ class Feed extends Entity implements IAPI, \JsonSerializable
}
/**
- * @return int
- */
- public function getId(): int
- {
- return $this->id;
- }
-
- /**
* @return string|null
*/
public function getLastModified(): ?string
@@ -476,19 +468,6 @@ class Feed extends Entity implements IAPI, \JsonSerializable
}
/**
- * @param int $id
- */
- public function setId(int $id): Feed
- {
- if ($this->id !== $id) {
- $this->id = $id;
- $this->markFieldUpdated('id');
- }
-
- return $this;
- }
-
- /**
* @param string|null $lastModified
*/
public function setLastModified(?string $lastModified = null): Feed
diff --git a/lib/Db/Folder.php b/lib/Db/Folder.php
index e4dbf0fe7..2efd65e96 100644
--- a/lib/Db/Folder.php
+++ b/lib/Db/Folder.php
@@ -52,11 +52,6 @@ class Folder extends Entity implements IAPI, \JsonSerializable
return $this->deletedAt;
}
- public function getId(): int
- {
- return $this->id;
- }
-
/**
* @return string|null
*/
@@ -115,16 +110,6 @@ class Folder extends Entity implements IAPI, \JsonSerializable
return $this;
}
- public function setId(int $id): self
- {
- if ($this->id !== $id) {
- $this->id = $id;
- $this->markFieldUpdated('id');
- }
-
- return $this;
- }
-
public function setLastModified(?string $lastModified = null): self
{
diff --git a/lib/Db/Item.php b/lib/Db/Item.php
index 555bcbb61..1dab1b96c 100644
--- a/lib/Db/Item.php
+++ b/lib/Db/Item.php
@@ -222,11 +222,6 @@ class Item extends Entity implements IAPI, \JsonSerializable
return $this->guidHash;
}
- public function getId(): string
- {
- return $this->id;
- }
-
public function getIntro(): string
{
return strip_tags($this->getBody());
@@ -440,16 +435,6 @@ class Item extends Entity implements IAPI, \JsonSerializable
return $this;
}
- public function setId(int $id): self
- {
- if ($this->id !== $id) {
- $this->id = $id;
- $this->markFieldUpdated('id');
- }
-
- return $this;
- }
-
public function setLastModified(string $lastModified = null): self
{
if ($this->lastModified !== $lastModified) {
diff --git a/lib/Migration/MigrateConfig.php b/lib/Migration/MigrateConfig.php
index 9f3b32291..4ba34fb5e 100644
--- a/lib/Migration/MigrateConfig.php
+++ b/lib/Migration/MigrateConfig.php
@@ -11,7 +11,6 @@
namespace OCA\News\Migration;
-use OCA\News\AppInfo\Application;
use OCA\News\Config\LegacyConfig;
use OCP\IConfig;
use OCP\Migration\IRepairStep;
@@ -40,13 +39,22 @@ class MigrateConfig implements IRepairStep
/**
* @param LegacyConfig $config
* @param IConfig $iConfig
- * @param Application $application To make sure the class is found below
*/
- public function __construct(LegacyConfig $config, IConfig $iConfig, Application $application)
+ public function __construct(LegacyConfig $config, IConfig $iConfig)
{
$this->config = $config;
$this->iConfig = $iConfig;
- $this->defaults = $application::DEFAULT_SETTINGS;
+
+ // copied from Application::default_settings
+ $this->defaults = [
+ 'autoPurgeMinimumInterval' => 60,
+ 'autoPurgeCount' => 200,
+ 'maxRedirects' => 10,
+ 'feedFetcherTimeout' => 60,
+ 'useCronUpdates' => true,
+ 'exploreUrl' => '',
+ 'updateInterval' => 3600,
+ ];
}
public function getName()
@@ -57,7 +65,7 @@ class MigrateConfig implements IRepairStep
public function run(IOutput $output)
{
$version = $this->iConfig->getAppValue('news', 'installed_version', '0.0.0');
- if (version_compare($version, '15.0.0', '>')) {
+ if (version_compare($version, '15.0.6', '>')) {
return;
}