diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-20 18:48:41 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-20 18:49:25 +0100 |
commit | fae882f834409e18174e05d19deea39a3bf01e7b (patch) | |
tree | 8bbac95e549db0d165aff7229de9b465ca8dd1ef /db/item.php | |
parent | bac9ffbc3a93a452270462cce69684e166856ce4 (diff) |
add a fingerprint for all articles
Diffstat (limited to 'db/item.php')
-rw-r--r-- | db/item.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/db/item.php b/db/item.php index c66b68a33..91b3215a6 100644 --- a/db/item.php +++ b/db/item.php @@ -61,6 +61,7 @@ class Item extends Entity implements IAPI, \JsonSerializable { protected $lastModified; protected $searchIndex; protected $rtl; + protected $fingerprint; public function __construct(){ $this->addType('pubDate', 'integer'); @@ -214,6 +215,11 @@ class Item extends Entity implements IAPI, \JsonSerializable { $this->getUrl() ) ); + $this->setFingerprint($this->computeFingerprint()); + } + + private function computeFingerprint() { + return md5($this->getTitle() . $this->getUrl() . $this->getBody()); } public function setUrl($url) { |