3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Feed\Reader\Collection;
12 class Category extends AbstractCollection
15 * Return a simple array of the most relevant slice of
16 * the collection values. For example, feed categories contain
17 * the category name, domain/URI, and other data. This method would
18 * merely return the most useful data - i.e. the category names.
22 public function getValues()
25 foreach ($this->getIterator() as $element) {
26 if (isset($element['label']) && ! empty($element['label'])) {
27 $categories[] = $element['label'];
29 $categories[] = $element['term'];
32 return array_unique($categories);