diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/join/JoinPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/join/JoinPluginBase.php index c258f3e..8b8b04f 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/join/JoinPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/join/JoinPluginBase.php @@ -134,7 +134,7 @@ class JoinPluginBase extends ContainerFactoryPluginBase { * @var bool * * @see Drupal\views\Plugin\HandlerBase::getTableJoin() - * @see Drupal\views\Plugin\views\query\Sql::adjust_join() + * @see Drupal\views\Plugin\views\query\Sql::adjustJoin() * @see Drupal\views\Plugin\views\relationship\RelationshipPluginBase::query() */ public $adjusted; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php index 3f7c8bd..b8bc969 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -158,7 +158,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o * @param bool $value * Should the view by distincted. */ - function set_distinct($value = TRUE) { + public function set_distinct($value = TRUE) { if (!(isset($this->no_distinct) && $value)) { $this->distinct = $value; } @@ -167,7 +167,7 @@ function set_distinct($value = TRUE) { /** * Set what field the query will count() on for paging. */ - function set_count_field($table, $field, $alias = NULL) { + public function set_count_field($table, $field, $alias = NULL) { if (empty($alias)) { $alias = $table . '_' . $field; } @@ -183,7 +183,7 @@ function set_count_field($table, $field, $alias = NULL) { * Set the table header; used for click-sorting because it's needed * info to modify the ORDER BY clause. */ - function set_header($header) { + public function set_header($header) { $this->header = $header; } @@ -290,7 +290,7 @@ public function submitOptionsForm(&$form, &$form_state) { * might have a relationship to an 'album' node, which might * have a relationship to an 'artist' node. */ - function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NULL) { + public function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NULL) { if (empty($link_point)) { $link_point = $this->view->storage->get('base_table'); } @@ -307,7 +307,7 @@ function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NUL // Make sure this join is adjusted for our relationship. if ($link_point && isset($this->relationships[$link_point])) { - $join = $this->adjust_join($join, $link_point); + $join = $this->adjustJoin($join, $link_point); } // Add the table directly to the queue to avoid accidentally marking @@ -364,13 +364,13 @@ function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NUL * adding parts to the query. Or FALSE if the table was not able to be * added. */ - function add_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $alias = NULL) { + public function add_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $alias = NULL) { if (!$this->ensure_path($table, $relationship, $join)) { return FALSE; } if ($join && $relationship) { - $join = $this->adjust_join($join, $relationship); + $join = $this->adjustJoin($join, $relationship); } return $this->queue_table($table, $relationship, $join, $alias); @@ -403,7 +403,7 @@ function add_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $a * adding parts to the query. Or FALSE if the table was not able to be * added. */ - function queue_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $alias = NULL) { + public function queue_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $alias = NULL) { // If the alias is set, make sure it doesn't already exist. if (isset($this->table_queue[$alias])) { return $alias; @@ -452,7 +452,7 @@ function queue_table($table, $relationship = NULL, JoinPluginBase $join = NULL, return FALSE; } - $join = $this->adjust_join($join, $relationship); + $join = $this->adjustJoin($join, $relationship); } $this->table_queue[$alias] = array( @@ -466,7 +466,7 @@ function queue_table($table, $relationship = NULL, JoinPluginBase $join = NULL, return $alias; } - function mark_table($table, $relationship, $alias) { + public function mark_table($table, $relationship, $alias) { // Mark that this table has been added. if (empty($this->tables[$relationship][$table])) { if (!isset($alias)) { @@ -508,7 +508,7 @@ function mark_table($table, $relationship, $alias) { * The alias used to refer to this specific table, or NULL if the table * cannot be ensured. */ - function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) { + public function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) { // ensure a relationship if (empty($relationship)) { $relationship = $this->view->storage->get('base_table'); @@ -543,7 +543,7 @@ function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) // Adjust this join for the relationship, which will ensure that the 'base' // table it links to is correct. Tables adjoined to a relationship // join to a link point, not the base table. - $join = $this->adjust_join($join, $relationship); + $join = $this->adjustJoin($join, $relationship); if ($this->ensure_path($table, $relationship, $join)) { // Attempt to eliminate redundant joins. If this table's @@ -587,7 +587,7 @@ function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) * query they will be added, but additional copies will NOT be added * if the table is already there. */ - function ensure_path($table, $relationship = NULL, $join = NULL, $traced = array(), $add = array()) { + public function ensure_path($table, $relationship = NULL, $join = NULL, $traced = array(), $add = array()) { if (!isset($relationship)) { $relationship = $this->view->storage->get('base_table'); } @@ -613,7 +613,7 @@ function ensure_path($table, $relationship = NULL, $join = NULL, $traced = array // Make sure that we're linking to the correct table for our relationship. foreach (array_reverse($add) as $table => $path_join) { - $this->queue_table($table, $relationship, $this->adjust_join($path_join, $relationship)); + $this->queue_table($table, $relationship, $this->adjustJoin($path_join, $relationship)); } return TRUE; } @@ -639,7 +639,7 @@ function ensure_path($table, $relationship = NULL, $join = NULL, $traced = array * Fix a join to adhere to the proper relationship; the left table can vary * based upon what relationship items are joined in on. */ - function adjust_join($join, $relationship) { + public function adjustJoin($join, $relationship) { if (!empty($join->adjusted)) { return $join; } @@ -707,7 +707,7 @@ function get_join_data($table, $base_table) { * If you need the alias of a table with a particular relationship, use * ensure_table(). */ - function get_table_info($table) { + public function get_table_info($table) { if (!empty($this->table_queue[$table])) { return $this->table_queue[$table]; } @@ -743,7 +743,7 @@ function get_table_info($table) { * @return $name * The name that this field can be referred to as. Usually this is the alias. */ - function add_field($table, $field, $alias = '', $params = array()) { + public function add_field($table, $field, $alias = '', $params = array()) { // We check for this specifically because it gets a special alias. if ($table == $this->view->storage->get('base_table') && $field == $this->view->storage->get('base_field') && empty($alias)) { $alias = $this->view->storage->get('base_field'); @@ -796,7 +796,7 @@ function add_field($table, $field, $alias = '', $params = array()) { * Remove all fields that may've been added; primarily used for summary * mode where we're changing the query because we didn't get data we needed. */ - function clear_fields() { + public function clear_fields() { $this->fields = array(); } @@ -834,7 +834,7 @@ function clear_fields() { * @see Drupal\Core\Database\Query\ConditionInterface::condition() * @see Drupal\Core\Database\Query\Condition */ - function add_where($group, $field, $value = NULL, $operator = NULL) { + public function add_where($group, $field, $value = NULL, $operator = NULL) { // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all // the default group. if (empty($group)) { @@ -872,7 +872,7 @@ function add_where($group, $field, $value = NULL, $operator = NULL) { * * @see QueryConditionInterface::where() */ - function add_where_expression($group, $snippet, $args = array()) { + public function add_where_expression($group, $snippet, $args = array()) { // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all // the default group. if (empty($group)) { @@ -915,7 +915,7 @@ function add_where_expression($group, $snippet, $args = array()) { * * @see SelectQueryInterface::havingCondition() */ - function add_having($group, $field, $value = NULL, $operator = NULL) { + public function add_having($group, $field, $value = NULL, $operator = NULL) { // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all // the default group. if (empty($group)) { @@ -953,7 +953,7 @@ function add_having($group, $field, $value = NULL, $operator = NULL) { * * @see QueryConditionInterface::having() */ - function add_having_expression($group, $snippet, $args = array()) { + public function add_having_expression($group, $snippet, $args = array()) { // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all // the default group. if (empty($group)) { @@ -992,7 +992,7 @@ function add_having_expression($group, $snippet, $args = array()) { * @param $params * Any params that should be passed through to the add_field. */ - function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { + public function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { // Only ensure the table if it's not the special random key. // @todo: Maybe it would make sense to just add a add_orderby_rand or something similar. if ($table && $table != 'rand') { @@ -1034,7 +1034,7 @@ function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params * for ensuring that the fields are fully qualified and the table is properly * added. */ - function add_groupby($clause) { + public function add_groupby($clause) { // Only add it if it's not already in there. if (!in_array($clause, $this->groupby)) { $this->groupby[] = $clause; @@ -1046,7 +1046,7 @@ function add_groupby($clause) { * * @see views_plugin_query_default::add_field() */ - function get_field_alias($table_alias, $field) { + public function get_field_alias($table_alias, $field) { return isset($this->field_aliases[$table_alias][$field]) ? $this->field_aliases[$table_alias][$field] : FALSE; } @@ -1062,7 +1062,7 @@ function add_tag($tag) { /** * Generates a unique placeholder used in the db query. */ - function placeholder($base = 'views') { + public function placeholder($base = 'views') { static $placeholders = array(); if (!isset($placeholders[$base])) { $placeholders[$base] = 0; @@ -1084,7 +1084,7 @@ function placeholder($base = 'views') { * @param $where * 'where' or 'having'. */ - function build_condition($where = 'where') { + public function build_condition($where = 'where') { $has_condition = FALSE; $has_arguments = FALSE; $has_filter = FALSE; @@ -1148,7 +1148,7 @@ function build_condition($where = 'where') { * @return array * An array of the fieldnames which are non-aggregates. */ - function get_non_aggregates() { + public function get_non_aggregates() { $non_aggregates = array(); foreach ($this->fields as $field) { $string = ''; @@ -1189,7 +1189,7 @@ function get_non_aggregates() { * @param Drupal\Core\Database\Query\SelectInterface $query * The drupal query object. */ - function compile_fields($query) { + public function compile_fields($query) { foreach ($this->fields as $field) { $string = ''; if (!empty($field['table'])) { @@ -1387,7 +1387,7 @@ public function query($get_count = FALSE) { /** * Get the arguments attached to the WHERE and HAVING clauses of this query. */ - function get_where_args() { + public function get_where_args() { $args = array(); foreach ($this->where as $group => $where) { $args = array_merge($args, $where['args']); @@ -1401,14 +1401,14 @@ function get_where_args() { /** * Let modules modify the query just prior to finalizing it. */ - function alter(ViewExecutable $view) { + public function alter(ViewExecutable $view) { \Drupal::moduleHandler()->invokeAll('views_query_alter', array($view, $this)); } /** * Builds the necessary info to execute the query. */ - function build(ViewExecutable $view) { + public function build(ViewExecutable $view) { // Make the query distinct if the option was set. if (!empty($this->options['distinct'])) { $this->set_distinct(TRUE); @@ -1433,7 +1433,7 @@ function build(ViewExecutable $view) { * Values to set: $view->result, $view->total_rows, $view->execute_time, * $view->current_page. */ - function execute(ViewExecutable $view) { + public function execute(ViewExecutable $view) { $external = FALSE; // Whether this query will run against an external database. $query = $view->build_info['query']; $count_query = $view->build_info['count_query']; @@ -1537,7 +1537,7 @@ function execute(ViewExecutable $view) { * @return array * An array of table information, keyed by table alias. */ - function get_entity_tables() { + public function get_entity_tables() { // Start with the base table. $entity_tables = array(); $views_data = Views::viewsData(); @@ -1581,7 +1581,7 @@ function get_entity_tables() { * $result->_entity. Otherwise, it gets stored in * $result->_relationship_entities[$relationship_id]; */ - function load_entities(&$results) { + public function load_entities(&$results) { $entity_tables = $this->get_entity_tables(); // No entity tables found, nothing else to do here. if (empty($entity_tables)) { @@ -1643,11 +1643,11 @@ function load_entities(&$results) { } } - function add_signature(ViewExecutable $view) { + public function add_signature(ViewExecutable $view) { $view->query->add_field(NULL, "'" . $view->storage->id() . ':' . $view->current_display . "'", 'view_name'); } - function get_aggregation_info() { + public function get_aggregation_info() { // @todo -- need a way to get database specific and customized aggregation // functions into here. return array( @@ -1728,11 +1728,11 @@ function get_aggregation_info() { ); } - function aggregation_method_simple($group_type, $field) { + public function aggregation_method_simple($group_type, $field) { return strtoupper($group_type) . '(' . $field . ')'; } - function aggregation_method_distinct($group_type, $field) { + public function aggregation_method_distinct($group_type, $field) { $group_type = str_replace('_distinct', '', $group_type); return strtoupper($group_type) . '(DISTINCT ' . $field . ')'; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php index a7ae4ac..561ff99 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php @@ -139,7 +139,7 @@ public function showExposeButton(&$form, &$form_state) { * Simple validate handler */ public function validateOptionsForm(&$form, &$form_state) { - $this->sort_validate($form, $form_state); + $this->sortValidate($form, $form_state); if (!empty($this->options['exposed'])) { $this->validateExposeForm($form, $form_state); } @@ -160,7 +160,7 @@ public function submitOptionsForm(&$form, &$form_state) { /** * Shortcut to display the value form. */ - function show_sort_form(&$form, &$form_state) { + public function show_sort_form(&$form, &$form_state) { $options = $this->sort_options(); if (!empty($options)) { $form['order'] = array( @@ -171,15 +171,15 @@ function show_sort_form(&$form, &$form_state) { } } - function sort_validate(&$form, &$form_state) { } + public function sortValidate(&$form, &$form_state) { } - function sort_submit(&$form, &$form_state) { } + public function sort_submit(&$form, &$form_state) { } /** * Provide a list of options for the default sort form. * Should be overridden by classes that don't override sort_form */ - function sort_options() { + public function sort_options() { return array( 'ASC' => t('Sort ascending'), 'DESC' => t('Sort descending'),