You are here

public function Atom::getCategories in Zircon Profile 8

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

Get all categories

Return value

Reader\Collection\Category

Overrides FeedInterface::getCategories

File

vendor/zendframework/zend-feed/src/Reader/Feed/Atom.php, line 359

Class

Atom

Namespace

Zend\Feed\Reader\Feed

Code

public function getCategories() {
  if (array_key_exists('categories', $this->data)) {
    return $this->data['categories'];
  }
  $categoryCollection = $this
    ->getExtension('Atom')
    ->getCategories();
  if (count($categoryCollection) == 0) {
    $categoryCollection = $this
      ->getExtension('DublinCore')
      ->getCategories();
  }
  $this->data['categories'] = $categoryCollection;
  return $this->data['categories'];
}