You are here

function invoice_query_alter in Invoice 7

Excludes node type "invoice" from search results

Parameters

object $query:

File

./invoice.module, line 1017
Invoice module

Code

function invoice_query_alter(&$query) {
  $is_search = FALSE;
  foreach ($query
    ->getTables() as $table) {
    if ($table['table'] == 'search_index') {
      $is_search = TRUE;
    }
  }
  if ($is_search) {
    $query
      ->condition('n.type', 'invoice', '<>');
  }
}