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/AbstractFeed.php \Zend\Feed\Reader\AbstractFeed::current()

Return the current entry

Return value

\Zend\Feed\Reader\AbstractEntry

File

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

Class

AbstractFeed

Namespace

Zend\Feed\Reader

Code

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