ViewExecutable::getHandler

public ViewExecutable::getHandler($display_id, $type, $id)

Gets the configuration of a handler instance on a given display.

Parameters

string $display_id: The machine name of the display.

string $type: The type of handler to retrieve.

string $id: The ID of the handler to retrieve.

Return value

array|null Either the handler instance's configuration, or NULL if the handler is not used on the display.

File

core/modules/views/src/ViewExecutable.php, line 2272

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

1
2
3
4
5
6
7
8
9
10
11
public function getHandler($display_id, $type, $id) {
  // Get info about the types so we can get the right data.
  $types = static::getHandlerTypes();
  // Initialize the display
  $this->setDisplay($display_id);
 
  // Get the existing configuration
  $fields = $this->displayHandlers->get($display_id)->getOption($types[$type]['plural']);
 
  return isset($fields[$id]) ? $fields[$id] : NULL;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.