db backup prior to drupal security update
[yaffs-website] / vendor / zendframework / zend-feed / src / Reader / Collection / Category.php
1 <?php
2 /**
3  * Zend Framework (http://framework.zend.com/)
4  *
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
8  */
9
10 namespace Zend\Feed\Reader\Collection;
11
12 class Category extends AbstractCollection
13 {
14     /**
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.
19      *
20      * @return array
21      */
22     public function getValues()
23     {
24         $categories = [];
25         foreach ($this->getIterator() as $element) {
26             if (isset($element['label']) && ! empty($element['label'])) {
27                 $categories[] = $element['label'];
28             } else {
29                 $categories[] = $element['term'];
30             }
31         }
32         return array_unique($categories);
33     }
34 }