class JoinTest

Same name in this branch
  1. 10 core/modules/views/tests/src/Kernel/Plugin/JoinTest.php \Drupal\Tests\views\Kernel\Plugin\JoinTest
Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Plugin/JoinTest.php \Drupal\Tests\views\Kernel\Plugin\JoinTest
  2. 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/join/JoinTest.php \Drupal\views_test_data\Plugin\views\join\JoinTest
  3. 8.9.x core/modules/views/tests/src/Kernel/Plugin/JoinTest.php \Drupal\Tests\views\Kernel\Plugin\JoinTest
  4. 8.9.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/join/JoinTest.php \Drupal\views_test_data\Plugin\views\join\JoinTest
  5. 11.x core/modules/views/tests/src/Kernel/Plugin/JoinTest.php \Drupal\Tests\views\Kernel\Plugin\JoinTest
  6. 11.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/join/JoinTest.php \Drupal\views_test_data\Plugin\views\join\JoinTest

Defines a join test plugin.

Hierarchy

Expanded class hierarchy of JoinTest

1 file declares its use of JoinTest
JoinTest.php in core/modules/views/tests/src/Kernel/Plugin/JoinTest.php

File

core/modules/views/tests/modules/views_test_data/src/Plugin/views/join/JoinTest.php, line 11

Namespace

Drupal\views_test_data\Plugin\views\join
View source
class JoinTest extends JoinPluginBase {
    
    /**
     * A value which is used to build an additional join condition.
     *
     * @var int
     */
    protected $joinValue;
    
    /**
     * Returns the joinValue property.
     *
     * @return int
     */
    public function getJoinValue() {
        return $this->joinValue;
    }
    
    /**
     * Sets the joinValue property.
     *
     * @param int $join_value
     *   The value of the join.
     */
    public function setJoinValue($join_value) {
        $this->joinValue = $join_value;
    }
    
    /**
     * {@inheritdoc}
     */
    public function buildJoin($select_query, $table, $view_query) {
        // Add an additional hardcoded condition to the query.
        $this->extra = 'views_test_data.uid = ' . $this->getJoinValue();
        parent::buildJoin($select_query, $table, $view_query);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
JoinPluginBase::$adjusted public property Defines whether a join has been adjusted.
JoinPluginBase::$configuration public property The configuration array passed by initJoin.
JoinPluginBase::$extra public property An array of extra conditions on the join.
JoinPluginBase::$extraOperator public property How all the extras will be combined. Either AND or OR.
JoinPluginBase::$field public property The field to join on (right field).
JoinPluginBase::$leftField public property The field we join to.
JoinPluginBase::$leftFormula public property A formula to be used instead of the left field.
JoinPluginBase::$leftTable public property The table we join to.
JoinPluginBase::$table public property The table to join (right table).
JoinPluginBase::$type public property The join type, so for example LEFT (default) or INNER.
JoinPluginBase::buildExtra protected function Builds a single extra condition.
JoinPluginBase::joinAddExtra protected function Adds the extras to the join condition. 1
JoinPluginBase::__construct public function Constructs a Drupal\views\Plugin\views\join\JoinPluginBase object. 1
JoinTest::$joinValue protected property A value which is used to build an additional join condition.
JoinTest::buildJoin public function Builds the SQL for the join this object represents. Overrides JoinPluginBase::buildJoin
JoinTest::getJoinValue public function Returns the joinValue property.
JoinTest::setJoinValue public function Sets the joinValue property.

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