You are here

public function ViewExecutable::getItems in Views (for Drupal 7) 8.3

Gets an array of handler instances for the current display.

Parameters

string $type: The type of handlers to retrieve.

string $display_id: (optional) A specific display machine name to use. If NULL, the current display will be used.

Return value

array An array of handler instances of a given type for this display.

File

lib/Drupal/views/ViewExecutable.php, line 2105
Definition of Drupal\views\ViewExecutable.

Class

ViewExecutable
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Namespace

Drupal\views

Code

public function getItems($type, $display_id = NULL) {
  $this
    ->setDisplay($display_id);
  if (!isset($display_id)) {
    $display_id = $this->current_display;
  }

  // Get info about the types so we can get the right data.
  $types = $this::viewsHandlerTypes();
  return $this->displayHandlers[$display_id]
    ->getOption($types[$type]['plural']);
}