summaryrefslogtreecommitdiffstats
path: root/businesslayer
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-19 13:01:44 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-19 13:01:44 +0200
commit76cc72393a2be7a54a849225accce6bbd1918129 (patch)
treec5c1f3ec45aae96b1c30f4a0382d3b53168ce530 /businesslayer
parent67e00e798d85d897e4793077aa14bcb4fb3d1765 (diff)
added a way to prevent feed from being updated
Diffstat (limited to 'businesslayer')
-rw-r--r--businesslayer/feedbusinesslayer.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/businesslayer/feedbusinesslayer.php b/businesslayer/feedbusinesslayer.php
index 983a4768a..9f3635e8a 100644
--- a/businesslayer/feedbusinesslayer.php
+++ b/businesslayer/feedbusinesslayer.php
@@ -118,18 +118,21 @@ class FeedBusinessLayer extends BusinessLayer {
public function update($feedId, $userId){
try {
$existingFeed = $this->mapper->find($feedId, $userId);
+
+ if($existingFeed->getPreventUpdate() === true) {
+ return;
+ }
+
try {
- list($feed, $items) = $this->feedFetcher->fetch($existingFeed->getUrl());
+ list($feed, $items) = $this->feedFetcher->fetch(
+ $existingFeed->getUrl());
- // insert items in reverse order because the first one is usually the
- // newest item
+ // insert items in reverse order because the first one is usually
+ // the newest item
for($i=count($items)-1; $i>=0; $i--){
$item = $items[$i];
$item->setFeedId($existingFeed->getId());
- // if a doesnotexist exception is being thrown the entry does not
- // exist and the item needs to be created, otherwise
- // update it
try {
$existing = $this->itemMapper->findByGuidHash(
$item->getGuidHash(), $feedId, $userId);