You are here

public function ProximityField::getValue in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/field/ProximityField.php \Drupal\geolocation\Plugin\views\field\ProximityField::getValue()

Gets the value that's supposed to be rendered.

This api exists so that other modules can easy set the values of the field without having the need to change the render method as well.

Parameters

\Drupal\views\ResultRow $values: An object containing all retrieved values.

string $field: Optional name of the field where the value is stored.

Overrides FieldPluginBase::getValue

1 call to ProximityField::getValue()
ProximityField::render in src/Plugin/views/field/ProximityField.php
Renders the field.

File

src/Plugin/views/field/ProximityField.php, line 130

Class

ProximityField
Field handler for geolocation field.

Namespace

Drupal\geolocation\Plugin\views\field

Code

public function getValue(ResultRow $values, $field = NULL) {
  $value = parent::getValue($values, $field);
  $value = self::convertDistance((double) $value, $this->options['display_unit'], TRUE);
  return $value;
}