You are here

class Category in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Collection/Category.php \Zend\Feed\Reader\Collection\Category

Hierarchy

Expanded class hierarchy of Category

1 file declares its use of Category
EntryInterface.php in vendor/zendframework/zend-feed/src/Reader/Entry/EntryInterface.php
4 string references to 'Category'
AddHandler::buildForm in core/modules/views_ui/src/Form/Ajax/AddHandler.php
Form constructor.
BlockLibraryController::listBlocks in core/modules/block/src/Controller/BlockLibraryController.php
Shows a list of blocks that can be added to a theme's layout.
BlockListBuilder::buildBlocksForm in core/modules/block/src/BlockListBuilder.php
Builds the main "Blocks" portion of the form.
ConfigTranslationBlockListBuilder::buildHeader in core/modules/config_translation/src/Controller/ConfigTranslationBlockListBuilder.php
Builds the header row for the entity listing.

File

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

Namespace

Zend\Feed\Reader\Collection
View source
class Category extends AbstractCollection {

  /**
   * 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 array
   */
  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);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Category::getValues public function 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. Overrides AbstractCollection::getValues