You are here

public function RateWidget::getOption in Rate 8.2

Return a single voting button as option by key.

Parameters

string $key: The key to return.

mixed $default_value: The default value to use in case the key is missing. Defaults to NULL.

Return value

mixed The value of the option or the default value if none found.

Overrides RateWidgetInterface::getOption

File

src/Entity/RateWidget.php, line 150

Class

RateWidget
Defines the Rate Widget configuration entity.

Namespace

Drupal\rate\Entity

Code

public function getOption($key, $default_value = NULL) {
  if (isset($this->options[$key])) {
    return $this->options[$key];
  }
  return $default_value;
}