Commit dd8056fb authored by alexpott's avatar alexpott

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
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment