You are here

function nodequeue_get_all_qids in Nodequeue 7.2

Same name and namespace in other branches
  1. 5.2 nodequeue.module \nodequeue_get_all_qids()
  2. 6.2 nodequeue.module \nodequeue_get_all_qids()

Get an array of qids using the pager query. This administrative list does no permission checking, so should only be available to users who have passed the 'administer queues' check.

Parameters

$page_size: The page size to use. If this is 0 or NULL, all queues will be returned. Defaults to 0.

$pager_element: In the rare event this should use another pager element, set this..

$bypass_cache: Boolean value indicating whether to bypass the cache or not.

Return value

$qids An array in the format: @code { array($qid => $qid) }

16 calls to nodequeue_get_all_qids()
action_nodequeue_add in includes/nodequeue.actions.inc
Old-style action to add a node to a queue.
action_nodequeue_remove in includes/nodequeue.actions.inc
Old-style action to remove a node from a queue.
nodequeue_add_action_form in includes/nodequeue.actions.inc
Configuration form for Add to Nodequeues action.
nodequeue_apachesolr_index_document_build_node in ./nodequeue.module
Implements hook_apachesolr_index_document_build_ENTITY_TYPE().
nodequeue_apachesolr_query_alter in ./nodequeue.module
Implements hook_apachesolr_query_alter().

... See full list

File

./nodequeue.module, line 837
Maintains queues of nodes in arbitrary order.

Code

function nodequeue_get_all_qids($page_size = 0, $pager_element = 0, $bypass_cache = FALSE) {
  $cache =& drupal_static(__FUNCTION__, array());
  if ($bypass_cache || empty($cache[$page_size])) {
    $query = db_select('nodequeue_queue', 'nq')
      ->fields('nq', array(
      'qid',
    ));
    if (!empty($page_size)) {
      $query
        ->extend('PagerDefault')
        ->extend('TableSort')
        ->limit($page_size)
        ->element($pager_element);
    }
    $qids = $query
      ->execute()
      ->fetchAllKeyed(0, 0);
    $cache[$page_size] = $qids;
  }
  return $cache[$page_size];
}