You are here

public function uc_addresses_handler_filter_access::query in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 views/uc_addresses_handler_filter_access.inc \uc_addresses_handler_filter_access::query()

Implements views_handler_filter#query().

This method needs to be overriden for two reasons:

  • To prevent Views from adding an extra WHERE condition to the query, which is not needed as this filter alters the results.
  • To add fields 'aid' and 'uid' to the table, so the filter is able to check access based on these two fields.

Overrides views_handler_filter_boolean_operator::query

File

views/uc_addresses_handler_filter_access.inc, line 49
Contains uc_addresses_handler_filter_access class.

Class

uc_addresses_handler_filter_access
A handler to filter a view by checking address access.

Code

public function query() {
  $this
    ->ensure_my_table();

  // Add our fields.
  $this->aid_field_alias = $this->query
    ->add_field($this->table_alias, $this->real_field);
  $this->uid_field_alias = $this->query
    ->add_field($this->table_alias, 'uid');

  // Set flag that the access filter is present.
  // This can be handy for other modules to know, for example
  // when they'd like to fix the pager problem.
  $this->view->uc_addresses_filter_access = TRUE;
}