b57c970fb6270fd905fb4d722c911007ec27eccf
[yaffs-website] / web / core / modules / views / tests / modules / views_test_data / src / Plugin / views / join / JoinTest.php
1 <?php
2
3 namespace Drupal\views_test_data\Plugin\views\join;
4
5 use Drupal\views\Plugin\views\join\JoinPluginBase;
6
7 /**
8  * Defines a join test plugin.
9  *
10  * @ViewsJoin("join_test")
11  */
12 class JoinTest extends JoinPluginBase {
13   /**
14    * A value which is used to build an additional join condition.
15    *
16    * @var int
17    */
18   protected $joinValue;
19
20   /**
21    * Returns the joinValue property.
22    *
23    * @return int
24    */
25   public function getJoinValue() {
26     return $this->joinValue;
27   }
28
29   /**
30    * Sets the joinValue property.
31    *
32    * @param int $join_value
33    */
34   public function setJoinValue($join_value) {
35     $this->joinValue = $join_value;
36   }
37
38
39   /**
40    * {@inheritdoc}
41    */
42   public function buildJoin($select_query, $table, $view_query) {
43     // Add an additional hardcoded condition to the query.
44     $this->extra = 'views_test_data.uid = ' . $this->getJoinValue();
45     parent::buildJoin($select_query, $table, $view_query);
46   }
47
48 }