Issue #2105425 by damiankloip: Clean up Views join plugins.
parent
5dd5b0c9b1
commit
129902be79
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\views\Plugin\views\join\JoinPluginBase.
|
||||
* Contains \Drupal\views\Plugin\views\join\JoinPluginBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\views\Plugin\views\join;
|
||||
|
@ -30,7 +30,7 @@ use Drupal\Core\Plugin\PluginBase;
|
|||
* );
|
||||
* $join = Views::pluginManager('join')->createInstance('standard', $configuration);
|
||||
*
|
||||
* Here is how you do complex joins:
|
||||
* To do complex joins:
|
||||
*
|
||||
* @code
|
||||
* class JoinComplex extends JoinPluginBase {
|
||||
|
@ -46,8 +46,6 @@ use Drupal\Core\Plugin\PluginBase;
|
|||
/**
|
||||
* Represents a join and creates the SQL necessary to implement the join.
|
||||
*
|
||||
* @todo It might make sense to create an interface for joins.
|
||||
*
|
||||
* Extensions of this class can be used to create more interesting joins.
|
||||
*/
|
||||
class JoinPluginBase extends PluginBase {
|
||||
|
@ -173,16 +171,16 @@ class JoinPluginBase extends PluginBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Build the SQL for the join this object represents.
|
||||
* Builds the SQL for the join this object represents.
|
||||
*
|
||||
* When possible, try to use table alias instead of table names.
|
||||
*
|
||||
* @param $select_query
|
||||
* An implementation of SelectQueryInterface.
|
||||
* An select query object.
|
||||
* @param $table
|
||||
* The base table to join.
|
||||
* @param $view_query
|
||||
* The source query, implementation of views_plugin_query.
|
||||
* @param \Drupal\views\Plugin\views\query\QueryPluginBase $view_query
|
||||
* The source views query.
|
||||
*/
|
||||
public function buildJoin($select_query, $table, $view_query) {
|
||||
if (empty($this->configuration['table formula'])) {
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\views\Plugin\views\join\Standard.
|
||||
* Contains \Drupal\views\Plugin\views\join\Standard.
|
||||
*/
|
||||
|
||||
namespace Drupal\views\Plugin\views\join;
|
||||
|
||||
use Drupal\Component\Annotation\PluginID;
|
||||
|
||||
/**
|
||||
* Default implementation of the join plugin.
|
||||
*
|
||||
|
|
|
@ -2,19 +2,18 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\views\Plugin\views\join\Subquery.
|
||||
* Contains \Drupal\views\Plugin\views\join\Subquery.
|
||||
*/
|
||||
|
||||
namespace Drupal\views\Plugin\views\join;
|
||||
use Drupal\Component\Annotation\PluginID;
|
||||
|
||||
/**
|
||||
* Join handler for relationships that join with a subquery as the left field.
|
||||
* eg:
|
||||
* E.g:
|
||||
* LEFT JOIN node node_term_data ON ([YOUR SUBQUERY HERE]) = node_term_data.nid
|
||||
*
|
||||
* join definition
|
||||
* same as Join class above, except:
|
||||
* Join definition:
|
||||
* same as \Drupal\views\Plugin\views\join\JoinPluginBase, except:
|
||||
* - left_query: The subquery to use in the left side of the join clause.
|
||||
*
|
||||
* @PluginID("subquery")
|
||||
|
@ -31,16 +30,14 @@ class Subquery extends JoinPluginBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Build the SQL for the join this object represents.
|
||||
* Builds the SQL for the join this object represents.
|
||||
*
|
||||
* @param $select_query
|
||||
* An implementation of SelectQueryInterface.
|
||||
* @param $table
|
||||
* @param \Drupal\Core\Database\Query\SelectInterface $select_query
|
||||
* The select query object.
|
||||
* @param string $table
|
||||
* The base table to join.
|
||||
* @param $view_query
|
||||
* The source query, implementation of views_plugin_query.
|
||||
* @return
|
||||
*
|
||||
* @param \Drupal\views\Plugin\views\query\QueryPluginBase $view_query
|
||||
* The source views query.
|
||||
*/
|
||||
public function buildJoin($select_query, $table, $view_query) {
|
||||
if (empty($this->configuration['table formula'])) {
|
||||
|
|
Loading…
Reference in New Issue