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()

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];
  }
}