Sets the configuration of a handler instance on a given display.
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.
array|null $item: An array of configuration for a handler, or NULL to remove this instance.
set_item_option()
public function setItem($display_id, $type, $id, $item) {
// Get info about the types so we can get the right data.
$types = $this::viewsHandlerTypes();
// Initialize the display.
$this
->setDisplay($display_id);
// Get the existing configuration.
$fields = $this->displayHandlers[$display_id]
->getOption($types[$type]['plural']);
if (isset($item)) {
$fields[$id] = $item;
}
else {
unset($fields[$id]);
}
// Store.
$this->displayHandlers[$display_id]
->setOption($types[$type]['plural'], $fields);
}