1 views_handler_filter_node_hidden_path.inc views_handler_filter_node_hidden_path::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_boolean_operator::query

File

core/modules/node/views/views_handler_filter_node_hidden_path.inc, line 18
Definition of views_handler_filter_node_hidden_path.

Class

views_handler_filter_node_hidden_path
Filter by content type's hidden path setting.

Code

function query() {
  $table = $this->ensure_my_table();
  $node_types = node_type_get_types();

  $enabled_types = array_filter($node_types, function($val) {
    return $val->settings['hidden_path'];
  });

  $diff_types = $enabled_types;
  if (!$this->value) {
    $diff_types = array_diff_key($node_types, $enabled_types);
  }

  $types_names = array_map(function($val) {
    return $val->type;
  }, $diff_types);

  $this->query->add_where_expression($this->options['group'], "$table.type IN (:types)", array(':types' => $types_names));
}