function FieldPluginBase::get_entity

Get the entity matching the current row and relationship.

Parameters

$values: An object containing all retrieved values.

5 calls to FieldPluginBase::get_entity()
BulkForm::views_form_submit in drupal/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php
Implements \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::views_form_submit().
Field::get_items in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Return an array of items for the field.
Link::render in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
Render the field.
Link::render in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php
Render the field.
NodeLink::render in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php
Render the field.

File

drupal/core/modules/views/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];
  }
}