Add additional information from external RSS feed
Hi @eko,
I am trying to use this bundle for jobboard where the bundle will be setup to fetch jobs based on rss. At present I can see and persist the following information to the database
- feed_item_title
- feed_item_description
- feed_item_link
- feed_item_pub_date
But I need more information like, city, country, etc.. (the rss feeds we will be fetching provide this information) so I have few questions
- Do I need to create custom
hydrator? - It is my understanding that inside the
hydratorI should be able to access the details i need (city, state and country), if this is true then how do I access it?
For example inside DefaultHydrator I can see that you are doing the following
$entity->setFeedItemTitle($entry->getTitle());
How do you know that you have access to $entry->getTitle() because when I var_dump $entry all i see is as following
object(Zend\Feed\Reader\Entry\Rss)[263]
protected 'xpathQueryRdf' => string '//rss:item[1]' (length=13)
protected 'xpathQueryRss' => string '//item[1]' (length=9)
protected 'data' =>
array (size=1)
'type' => string 'rss-20' (length=6)
protected 'domDocument' =>
object(DOMDocument)[36]
protected 'entry' =>
object(DOMElement)[266]
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
protected 'extensions' =>
array (size=7)
'Slash\Entry' =>
object(Zend\Feed\Reader\Extension\Slash\Entry)[370]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
'WellFormedWeb\Entry' =>
object(Zend\Feed\Reader\Extension\WellFormedWeb\Entry)[376]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
'Thread\Entry' =>
object(Zend\Feed\Reader\Extension\Thread\Entry)[369]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
'Podcast\Entry' =>
object(Zend\Feed\Reader\Extension\Podcast\Entry)[372]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
'DublinCore\Entry' =>
object(Zend\Feed\Reader\Extension\DublinCore\Entry)[373]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
'Content\Entry' =>
object(Zend\Feed\Reader\Extension\Content\Entry)[374]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
'Atom\Entry' =>
object(Zend\Feed\Reader\Extension\Atom\Entry)[375]
protected 'data' =>
array (size=1)
...
protected 'domDocument' =>
object(DOMDocument)[36]
...
protected 'entry' =>
object(DOMElement)[266]
...
protected 'entryKey' => int 0
protected 'xpath' =>
object(DOMXPath)[265]
...
protected 'xpathPrefix' => string '//item[1]' (length=9)
I do not see any object here that gives access to title, content or link and so on.
So a bottom line is how do I see what all elements I have that I can pass to my Entity?
I hope my question is clear :)