You are here

function FieldPluginBase::get_entity in Views (for Drupal 7) 8.3

Get the entity matching the current row and relationship.

Parameters

$values: An object containing all retrieved values.

4 calls to FieldPluginBase::get_entity()
Field::get_items in lib/Views/field/Plugin/views/field/Field.php
Return an array of items for the field.
Link::render in lib/Views/node/Plugin/views/field/Link.php
Render the field.
Link::render in lib/Views/comment/Plugin/views/field/Link.php
Render the field.
NodeLink::render in lib/Views/comment/Plugin/views/field/NodeLink.php
Render the field.

File

lib/Drupal/views/Plugin/views/field/FieldPluginBase.php, line 363
Definition of Drupal\views\Plugin\views\field\FieldPluginBase.

Class

FieldPluginBase
Base field handler that has no options and renders an unformatted field.

Namespace

Drupal\views\Plugin\views\field

Code

function get_entity($values) {
  $relationship_id = $this->options['relationship'];
  if ($relationship_id == 'none') {
    return $values->_entity;
  }
  else {
    return $values->_relationship_entities[$relationship_id];
  }
}