Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

geImage() on entries/Items throws error #47

Closed
rajjanorkar opened this issue Oct 16, 2017 · 1 comment
Closed

geImage() on entries/Items throws error #47

rajjanorkar opened this issue Oct 16, 2017 · 1 comment
Labels

Comments

@rajjanorkar
Copy link
Contributor

rajjanorkar commented Oct 16, 2017

I am getting error when i am trying to get the images of every feed entry using getImage() function.

  Reader::setHttpClient(new GuzzleClient());
    $feed = Reader::import('http://sportbild.bild.de/rss/vw-startseite/vw-startseite-45028186,sort=1,view=rss2.sport.xml');
    $data = [
        'title'        => $feed->getTitle(),
        'link'         => $feed->getLink(),
        'dateModified' => $feed->getDateModified(),
        'description'  => $feed->getDescription(),
        'language'     => $feed->getLanguage(),
        'entries'      => [],
    ];

    foreach ($feed as $entry) {
        $edata = [
            'title'        => $entry->getTitle(),
            'description'  => $entry->getDescription(),
            'dateModified' => $entry->getDateModified(),
            'authors'      => $entry->getAuthors(),
            'link'         => $entry->getLink(),
            'content'      => $entry->getContent(),
            'images'      => $entry->getImage(),
        ];
        $data['entries'][] = $edata;
    }`

Below is the error i am getting

Method: getImage does not exist and could not be located on a registered Extension in AbstractEntry.php (line 206) at AbstractEntry->__call('getImage', array())

@froschdesign
Copy link
Member

@rajjanorkar

I am getting error when i am trying to get the images of every feed entry using getImage() function.

This is correct, because an entry has no image. Only the feed or channel element has got an image / logo.

Reference:

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

No branches or pull requests

2 participants