You are here

public function AbstractFeed::current in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php \Zend\Feed\Reader\AbstractFeed::current()
  2. 8 vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php \Zend\Feed\Reader\Feed\AbstractFeed::current()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php \Zend\Feed\Reader\Feed\AbstractFeed::current()

Return the current entry

Return value

\Zend\Feed\Reader\Entry\EntryInterface

File

vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php, line 131

Class

AbstractFeed

Namespace

Zend\Feed\Reader\Feed

Code

public function current() {
  if (substr($this
    ->getType(), 0, 3) == 'rss') {
    $reader = new Reader\Entry\Rss($this->entries[$this
      ->key()], $this
      ->key(), $this
      ->getType());
  }
  else {
    $reader = new Reader\Entry\Atom($this->entries[$this
      ->key()], $this
      ->key(), $this
      ->getType());
  }
  $reader
    ->setXpath($this->xpath);
  return $reader;
}