diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-08-28 17:26:38 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-08-28 17:26:38 +0200 |
commit | a9eb72911b6f022da645dc08cf8c0f4b1702d1e1 (patch) | |
tree | 4e16f84cd4a8d0214fc5a445f4817bc4a3a93bf0 /businesslayer | |
parent | 998b3c29438b09e50d2c56ed982b48df8038a910 (diff) |
add enhancers for articles, fix #14
Diffstat (limited to 'businesslayer')
-rw-r--r-- | businesslayer/feedbusinesslayer.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/businesslayer/feedbusinesslayer.php b/businesslayer/feedbusinesslayer.php index 8cd4fc663..764cb07c6 100644 --- a/businesslayer/feedbusinesslayer.php +++ b/businesslayer/feedbusinesslayer.php @@ -36,6 +36,8 @@ use \OCA\News\Utility\Fetcher; use \OCA\News\Utility\FetcherException; use \OCA\News\Utility\ImportParser; +use \OCA\News\Utility\ArticleEnhancer\Enhancer; + class FeedBusinessLayer extends BusinessLayer { private $feedFetcher; @@ -44,12 +46,14 @@ class FeedBusinessLayer extends BusinessLayer { private $timeFactory; private $importParser; private $autoPurgeMinimumInterval; + private $enhancer; public function __construct(FeedMapper $feedMapper, Fetcher $feedFetcher, ItemMapper $itemMapper, API $api, TimeFactory $timeFactory, ImportParser $importParser, - $autoPurgeMinimumInterval){ + $autoPurgeMinimumInterval, + Enhancer $enhancer){ parent::__construct($feedMapper); $this->feedFetcher = $feedFetcher; $this->itemMapper = $itemMapper; @@ -57,6 +61,7 @@ class FeedBusinessLayer extends BusinessLayer { $this->timeFactory = $timeFactory; $this->importParser = $importParser; $this->autoPurgeMinimumInterval = $autoPurgeMinimumInterval; + $this->enhancer = $enhancer; } /** @@ -118,6 +123,7 @@ class FeedBusinessLayer extends BusinessLayer { continue; } catch(DoesNotExistException $ex){ $unreadCount += 1; + $item = $this->enhancer->enhance($item); $this->itemMapper->insert($item); } } @@ -183,6 +189,7 @@ class FeedBusinessLayer extends BusinessLayer { try { $this->itemMapper->findByGuidHash($item->getGuidHash(), $feedId, $userId); } catch(DoesNotExistException $ex){ + $item = $this->enhancer->enhance($item); $this->itemMapper->insert($item); } } |