1: <?php
2: /**
3: * This file is part of the FastFeed package.
4: *
5: * (c) Daniel González <daniel@desarrolla2.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10: namespace FastFeed\Aggregator;
11:
12: use DOMElement;
13: use FastFeed\Item;
14:
15: /**
16: * RSSContentAggregator
17: *
18: * This Aggregator seem for a content:encoded field in item node and set as description
19: */
20: class RSSContentAggregator extends AbstractAggregator implements AggregatorInterface
21: {
22: /**
23: * Execute the Aggregator
24: *
25: * @param DOMElement $node
26: * @param Item $item
27: */
28: public function process(DOMElement $node, Item $item)
29: {
30: $this->setContent($node, $item);
31: }
32:
33: /**
34: *
35: * @param DOMElement $node
36: * @param Item $item
37: */
38: protected function setContent(DOMElement $node, Item $item)
39: {
40: $value = $this->getNodeValueByTagNameNS($node, 'http://purl.org/rss/1.0/modules/content/', 'encoded');
41:
42: if ($value) {
43: $item->setContent($value);
44: }
45: }
46: }
47: