Skip to content
Snippets Groups Projects
Commit dd8056fb authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2699637 by leolando.tan, jhodgdon, jummonk: Incorrect and unclear...

Issue #2699637 by leolando.tan, jhodgdon, jummonk: Incorrect and unclear documentation on Views join handler plugins (default is LEFT JOIN)
parent a7b61e3c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -16,12 +16,13 @@
* They must be annotated with \Drupal\views\Annotation\ViewsJoin annotation,
* and they must be in namespace directory Plugin\views\join.
*
* Here are some examples of how to join from table one to table two so it
* produces the following SQL:
* Here are some examples of configuration for the join plugins.
*
* For this SQL:
* @code
* INNER JOIN {two} ON one.field_a = two.field_b
* LEFT JOIN {two} ON one.field_a = two.field_b
* @endcode
* The required php code for this kind of functionality is the following:
* Use this configuration:
* @code
* $configuration = array(
* 'table' => 'two',
......@@ -32,12 +33,17 @@
* );
* $join = Views::pluginManager('join')->createInstance('standard', $configuration);
* @endcode
* Note that the default join type is a LEFT join when 'type' is not supplied in
* the join plugin configuration.
*
* For this SQL:
* @code
* INNER JOIN {two} ON one.field_a = two.field_b AND one.field_c = 'some_val'
* @endcode
* The required php code for this kind of functionality is the following:
* Use this configuration:
* @code
* $configuration = array(
* 'type' => 'INNER',
* 'table' => 'two',
* 'field' => 'field_b',
* 'left_table' => 'one',
......@@ -52,12 +58,15 @@
* );
* $join = Views::pluginManager('join')->createInstance('standard', $configuration);
* @endcode
*
* For this SQL:
* @code
* INNER JOIN {two} ON one.field_a = two.field_b AND two.field_d = 'other_val'
* @endcode
* The required php code for this kind of functionality is the following:
* Use this configuration:
* @code
* $configuration = array(
* 'type' => 'INNER',
* 'table' => 'two',
* 'field' => 'field_b',
* 'left_table' => 'one',
......@@ -72,12 +81,15 @@
* );
* $join = Views::pluginManager('join')->createInstance('standard', $configuration);
* @endcode
*
* For this SQL:
* @code
* INNER JOIN {two} ON one.field_a = two.field_b AND one.field_c = two.field_d
* @endcode
* The required php code for this kind of functionality is the following:
* Use this configuration:
* @code
* $configuration = array(
* 'type' => 'INNER',
* 'table' => 'two',
* 'field' => 'field_b',
* 'left_table' => 'one',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment