You are here

public function RelationshipPluginBase::init in Views (for Drupal 7) 8.3

Init handler to let relationships live on tables other than the table they operate on.

Overrides HandlerBase::init

2 calls to RelationshipPluginBase::init()
EntityReverse::init in lib/Views/field/Plugin/views/relationship/EntityReverse.php
Init handler to let relationships live on tables other than the table they operate on.
NodeTermData::init in lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php
Init handler to let relationships live on tables other than the table they operate on.
2 methods override RelationshipPluginBase::init()
EntityReverse::init in lib/Views/field/Plugin/views/relationship/EntityReverse.php
Init handler to let relationships live on tables other than the table they operate on.
NodeTermData::init in lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php
Init handler to let relationships live on tables other than the table they operate on.

File

lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php, line 51
Definition of Drupal\views\Plugin\views\relationship\RelationshipPluginBase.

Class

RelationshipPluginBase
Simple relationship handler that allows a new version of the primary table to be linked in.

Namespace

Drupal\views\Plugin\views\relationship

Code

public function init(ViewExecutable $view, &$options) {
  $this
    ->setOptionDefaults($this->options, $this
    ->defineOptions());
  parent::init($view, $options);
  if (isset($this->definition['relationship table'])) {
    $this->table = $this->definition['relationship table'];
  }
  if (isset($this->definition['relationship field'])) {

    // Set both realField and field so custom handler can rely on the old
    // field value.
    $this->realField = $this->field = $this->definition['relationship field'];
  }
}