Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional information from external RSS feed #55

Open
shairyar opened this issue Apr 16, 2016 · 0 comments
Open

Add additional information from external RSS feed #55

shairyar opened this issue Apr 16, 2016 · 0 comments

Comments

@shairyar
Copy link

shairyar commented Apr 16, 2016

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

  1. Do I need to create custom hydrator?
  2. It is my understanding that inside the hydrator I 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant