ViewExecutable::setHandlerOption

public ViewExecutable::setHandlerOption($display_id, $type, $id, $option, $value)

Sets an option on a handler instance.

Use this only if you have just 1 or 2 options to set; if you have many, consider getting the handler instance, adding the options and using set_item() directly.

Parameters

string $display_id: The machine name of the display.

string $type: The type of handler being set.

string $id: The ID of the handler being set.

string $option: The configuration key for the value being set.

mixed $value: The value being set.

See also

set_item()

File

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

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function setHandlerOption($display_id, $type, $id, $option, $value) {
  $item = $this->getHandler($display_id, $type, $id);
  $item[$option] = $value;
  $this->setHandler($display_id, $type, $id, $item);
}
doc_Drupal
2016-10-29 09:54:27
Comments
Leave a Comment

Please login to continue.