You are here

protected function SimpleMathField::getFieldRelationship in Views Simple Math Field 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/field/SimpleMathField.php \Drupal\views_simple_math_field\Plugin\views\field\SimpleMathField::getFieldRelationship()

Determine if the field comes from a relationship.

Parameters

$field:

Return value

mixed

1 call to SimpleMathField::getFieldRelationship()
SimpleMathField::getFieldValue in src/Plugin/views/field/SimpleMathField.php
Get the value of a simple math field.

File

src/Plugin/views/field/SimpleMathField.php, line 191
Defines Drupal\views_simple_math_field\Plugin\views\field\SimpleMathField.

Class

SimpleMathField
Field handler to complete mathematical operation.

Namespace

Drupal\views_simple_math_field\Plugin\views\field

Code

protected function getFieldRelationship($field) {
  $field_handler = $this->displayHandler
    ->getHandler('field', $field)->options;
  if (!empty($field_handler['relationship']) && $field_handler['relationship'] !== 'none') {
    $relationship = $field_handler['relationship'];
  }
  else {
    $relationship = NULL;
  }
  return $relationship;
}