You are here

public function MachineName::getValueOptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/MachineName.php \Drupal\views\Plugin\views\field\MachineName::getValueOptions()
1 call to MachineName::getValueOptions()
MachineName::preRender in core/modules/views/src/Plugin/views/field/MachineName.php
Runs before any fields are rendered.

File

core/modules/views/src/Plugin/views/field/MachineName.php, line 27

Class

MachineName
Field handler which allows to show machine name content as human name.

Namespace

Drupal\views\Plugin\views\field

Code

public function getValueOptions() {
  if (isset($this->valueOptions)) {
    return;
  }
  if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) {
    if (isset($this->definition['options arguments']) && is_array($this->definition['options arguments'])) {
      $this->valueOptions = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
    }
    else {
      $this->valueOptions = call_user_func($this->definition['options callback']);
    }
  }
  else {
    $this->valueOptions = [];
  }
}