function FieldOrLanguageJoinTest::buildJoin

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php \Drupal\Tests\views\Kernel\Plugin\FieldOrLanguageJoinTest::buildJoin()
  2. 8.9.x core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php \Drupal\Tests\views\Kernel\Plugin\FieldOrLanguageJoinTest::buildJoin()
  3. 10 core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php \Drupal\Tests\views\Kernel\Plugin\FieldOrLanguageJoinTest::buildJoin()

Builds a join using the given configuration.

Parameters

\Drupal\views\ViewExecutable $view: The view used in this test.

$configuration: The join plugin configuration.

$table_alias: The table alias to use for the join.

Return value

array The join information for the joined table. See \Drupal\Core\Database\Query\Select::$tables for more information on the structure of the array.

2 calls to FieldOrLanguageJoinTest::buildJoin()
FieldOrLanguageJoinTest::testBase in core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php
Tests base join functionality.
FieldOrLanguageJoinTest::testLanguageBundleConditions in core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php
Tests the adding of conditions by the join plugin.

File

core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php, line 197

Class

FieldOrLanguageJoinTest
Tests the "field OR language" join plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

protected function buildJoin(ViewExecutable $view, $configuration, $table_alias) {
    // Build the actual join values and read them back from the query object.
    $query = \Drupal::database()->select('node');
    $join = $this->manager
        ->createInstance('field_or_language_join', $configuration);
    $this->assertInstanceOf(FieldOrLanguageJoin::class, $join);
    $table = [
        'alias' => $table_alias,
    ];
    $join->buildJoin($query, $table, $view->query);
    $tables = $query->getTables();
    $join_info = $tables[$table['alias']];
    return $join_info;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.