You are here

function search_api_exclude_get_excluded in Search API exclude 7

Determines which of the given nodes should be excluded from indexing.

Parameters

array|null $nids: (optional) The NIDs of the nodes for which to check. If NULL, all "Exclude" entries are retrieved.

Return value

array The NIDs of all nodes that should be excluded from indexing.

2 calls to search_api_exclude_get_excluded()
search_api_exclude_form_node_form_alter in ./search_api_exclude.module
Implements hook_form_BASE_FORM_ID_alter() for node_form().
search_api_exclude_search_api_index_items_alter in ./search_api_exclude.module
Implements hook_search_api_index_items_alter().

File

./search_api_exclude.module, line 204
Allows users to exclude specific nodes from indexing by Search API.

Code

function search_api_exclude_get_excluded(array $nids = NULL) {
  if ($nids === array()) {
    return array();
  }
  $select = db_select('search_api_exclude', 'e')
    ->fields('e', array(
    'nid',
  ));
  if (isset($nids)) {
    $select
      ->condition('nid', $nids);
  }
  return $select
    ->execute()
    ->fetchCol();
}