You are here

public function Category::getValues in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/Reader/Collection/Category.php \Zend\Feed\Reader\Collection\Category::getValues()

Return a simple array of the most relevant slice of the collection values. For example, feed categories contain the category name, domain/URI, and other data. This method would merely return the most useful data - i.e. the category names.

Return value

array

Overrides AbstractCollection::getValues

File

vendor/zendframework/zend-feed/src/Reader/Collection/Category.php, line 22

Class

Category

Namespace

Zend\Feed\Reader\Collection

Code

public function getValues() {
  $categories = [];
  foreach ($this
    ->getIterator() as $element) {
    if (isset($element['label']) && !empty($element['label'])) {
      $categories[] = $element['label'];
    }
    else {
      $categories[] = $element['term'];
    }
  }
  return array_unique($categories);
}