You are here

function _fe_nodequeue_get_qid_map in Features Extra 7

Return a map of queue name to qid values to aid in various lookups.

This is based on nodequeue_get_qid_map() but uses drupal_static() instead of a static variable to cache the results.

@todo Add a link to the issue that converts this to drupal_static(). @todo Create a followup issue to remove this once the above issue is fixed. We will need to keep this in for a while to provide backwards compatibility for people running old versions of Nodequeue.

Return value

array A array of qids, keyed by machine name.

See also

nodequeue_get_qid_map()

2 calls to _fe_nodequeue_get_qid_map()
fe_nodequeue_features_revert in fe_nodequeue/fe_nodequeue.module
Implements hook_features_revert().
_fe_nodequeue_load_queue_by_name in fe_nodequeue/fe_nodequeue.module
Return a queue by its machine name.
2 string references to '_fe_nodequeue_get_qid_map'
FeaturesExtraNodequeueTestCase::override_fe_nodequeue in tests/fe_nodequeue.test
Change the title of the test nodequeue so the component becomes overridden.
_fe_nodequeue_save_queue in fe_nodequeue/fe_nodequeue.module
Save a nodequeue queue.

File

fe_nodequeue/fe_nodequeue.module, line 232
Main functions and hook implementations of the FE Nodequeue module.

Code

function _fe_nodequeue_get_qid_map() {
  $map =& drupal_static(__FUNCTION__, array());
  if (!$map) {
    $result = db_query("SELECT qid, name FROM {nodequeue_queue}");
    while ($get = $result
      ->fetchObject()) {
      $map[$get->name] = $get->qid;
    }
  }
  return $map;
}