From 15c422c6489d0b1a907353e31f8d65adff9784b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 12 Sep 2016 10:39:34 +0200 Subject: [PATCH] [FeedExpander] implement default parseItem() method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- lib/FeedExpander.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php index 7e9c50d..4251abe 100644 --- a/lib/FeedExpander.php +++ b/lib/FeedExpander.php @@ -168,7 +168,20 @@ abstract class FeedExpander extends BridgeAbstract { * @param $item the input rss item * @return a RSS-Bridge Item, with (hopefully) the whole content) */ - abstract protected function parseItem($item); + protected function parseItem($item){ + switch($this->feedType){ + case 'RSS_1_0': + return $this->parseRSS_1_0_Item($item); + break; + case 'RSS_2_0': + return $this->parseRSS_2_0_Item($item); + break; + case 'ATOM_1_0': + return $this->parseATOMItem($item); + break; + default: $this->returnClientError('Unknown version ' . $this->getInput('version') . '!'); + } + } public function getURI(){ return $this->uri;