You are here

public static function Views::getHandlerTypes in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Views.php \Drupal\views\Views::getHandlerTypes()

Provide a list of views handler types used in a view, with some information about them.

Return value

array An array of associative arrays containing:

  • title: The title of the handler type.
  • ltitle: The lowercase title of the handler type.
  • stitle: A singular title of the handler type.
  • lstitle: A singular lowercase title of the handler type.
  • plural: Plural version of the handler type.
  • (optional) type: The actual internal used handler type. This key is just used for header,footer,empty to link to the internal type: area.
6 calls to Views::getHandlerTypes()
DisplayPluginBase::calculateCacheMetadata in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Calculates the display's cache metadata by inspecting each handler/plugin.
DisplayPluginBase::getAllHandlers in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Gets all the handlers used by the display.
View::onDependencyRemoval in core/modules/views/src/Entity/View.php
Informs the entity that entities it depends on will be deleted.
ViewExecutable::getHandlerTypes in core/modules/views/src/ViewExecutable.php
Provides a list of views handler types used in a view.
ViewsEntitySchemaSubscriber::processHandlers in core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php
Applies a callable onto all handlers of all passed in views.

... See full list

File

core/modules/views/src/Views.php, line 424

Class

Views
Static service container wrapper for views.

Namespace

Drupal\views

Code

public static function getHandlerTypes() {

  // Statically cache this so translation only occurs once per request for all
  // of these values.
  if (!isset(static::$handlerTypes)) {
    static::$handlerTypes = [
      'field' => [
        // title
        'title' => static::t('Fields'),
        // Lowercase title for mid-sentence.
        'ltitle' => static::t('fields'),
        // Singular title.
        'stitle' => static::t('Field'),
        // Singular lowercase title for mid sentence
        'lstitle' => static::t('field'),
        'plural' => 'fields',
      ],
      'argument' => [
        'title' => static::t('Contextual filters'),
        'ltitle' => static::t('contextual filters'),
        'stitle' => static::t('Contextual filter'),
        'lstitle' => static::t('contextual filter'),
        'plural' => 'arguments',
      ],
      'sort' => [
        'title' => static::t('Sort criteria'),
        'ltitle' => static::t('sort criteria'),
        'stitle' => static::t('Sort criterion'),
        'lstitle' => static::t('sort criterion'),
        'plural' => 'sorts',
      ],
      'filter' => [
        'title' => static::t('Filter criteria'),
        'ltitle' => static::t('filter criteria'),
        'stitle' => static::t('Filter criterion'),
        'lstitle' => static::t('filter criterion'),
        'plural' => 'filters',
      ],
      'relationship' => [
        'title' => static::t('Relationships'),
        'ltitle' => static::t('relationships'),
        'stitle' => static::t('Relationship'),
        'lstitle' => static::t('Relationship'),
        'plural' => 'relationships',
      ],
      'header' => [
        'title' => static::t('Header'),
        'ltitle' => static::t('header'),
        'stitle' => static::t('Header'),
        'lstitle' => static::t('Header'),
        'plural' => 'header',
        'type' => 'area',
      ],
      'footer' => [
        'title' => static::t('Footer'),
        'ltitle' => static::t('footer'),
        'stitle' => static::t('Footer'),
        'lstitle' => static::t('Footer'),
        'plural' => 'footer',
        'type' => 'area',
      ],
      'empty' => [
        'title' => static::t('No results behavior'),
        'ltitle' => static::t('no results behavior'),
        'stitle' => static::t('No results behavior'),
        'lstitle' => static::t('No results behavior'),
        'plural' => 'empty',
        'type' => 'area',
      ],
    ];
  }
  return static::$handlerTypes;
}