Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RelationshipPluginBase.php

function RelationshipPluginBase::init

Overrides \Drupal\views\Plugin\views\HandlerBase::init().

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

Overrides HandlerBase::init

File

core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php, line 66

Class

RelationshipPluginBase
Relationship plugin base.

Namespace

Drupal\views\Plugin\views\relationship

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) {
    parent::init($view, $display, $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'];
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal