You are here

function views_related_content_handler_filter_field_reference::query in Views Related Content 7

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_in_operator::query

File

views/views_related_content_handler_filter_field_reference.inc, line 24

Class

views_related_content_handler_filter_field_reference

Code

function query() {
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $nodeid = arg(1);
  }
  if (isset($nodeid)) {
    $result = db_select('node', 'n')
      ->fields('n')
      ->condition('nid', $nodeid, '=');
    $result = $result
      ->execute();
    return $result
      ->fetchAssoc();
  }
}