public function FieldPluginBase::getEntity

Gets the entity matching the current row and relationship.

Parameters

\stdClass $values: An object containing all retrieved values.

Return value

\Drupal\Core\Entity\EntityInterface Returns the entity matching the values.

9 calls to FieldPluginBase::getEntity()
BulkFormBase::views_form_submit in drupal/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php
Submit handler for the bulk form.
Field::getItems 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/user/lib/Drupal/user/Plugin/views/field/Link.php
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::render().
Link::render in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php
Render the field.

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php, line 370
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

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