class JoinTest

Defines a join test plugin.

Plugin annotation


@Plugin(
  id = "join_test",
  title = @Translation("Join test")
)

Hierarchy

Expanded class hierarchy of JoinTest

1 file declares its use of JoinTest
JoinTest.php in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/JoinTest.php
Definition of Drupal\views\Tests\Plugin\JoinTest.

File

drupal/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/join/JoinTest.php, line 22
Definition of Drupal\views_test_data\views\join\JoinTest.

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
   */
  public function setJoinValue($join_value) {
    $this->joinValue = $join_value;
  }

  /**
   * Overrides Drupal\views\Plugin\views\join\JoinPluginBase::buildJoin().
   */
  public function buildJoin($select_query, $table, $view_query) {

    // Add an additional hardcoded condition to the query.
    $this->extra = 'node.uid = ' . $this
      ->getJoinValue();
    parent::buildJoin($select_query, $table, $view_query);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
JoinPluginBase::$adjusted public property Defines whether a join has been adjusted.
JoinPluginBase::$configuration public property The configuration array passed by initJoin. Overrides PluginBase::$configuration
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::$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::__construct public function Constructs a Drupal\views\Plugin\views\join\JoinPluginBase object. Overrides PluginBase::__construct 1
JoinTest::$joinValue protected property A value which is used to build an additional join condition.
JoinTest::buildJoin public function Overrides Drupal\views\Plugin\views\join\JoinPluginBase::buildJoin(). Overrides JoinPluginBase::buildJoin
JoinTest::getJoinValue public function Returns the joinValue property.
JoinTest::setJoinValue public function Sets the joinValue property.
PluginBase::$discovery protected property The discovery object.
PluginBase::$plugin_id protected property The plugin_id.
PluginBase::getDefinition public function Implements Drupal\Component\Plugin\PluginInterface::getDefinition(). Overrides PluginInspectionInterface::getDefinition
PluginBase::getPluginId public function Implements Drupal\Component\Plugin\PluginInterface::getPluginId(). Overrides PluginInspectionInterface::getPluginId