You are here

function boost_cache_get_node_relationships in Boost 6

Creates a parent child relationship for pages like views.

Parameters

$relationships: Array of $router_item array "objects" Required ['page_callback'] ['page_type'] ['page_id'] Optional ['base_dir']

1 call to boost_cache_get_node_relationships()
boost_expire_node in ./boost.module
Expires a node from the cache; including related pages.

File

./boost.module, line 4036
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_cache_get_node_relationships($relationships) {
  if (!is_array($relationships)) {
    return FALSE;
  }
  $results = array();
  foreach ($relationships as $data) {

    // If one of the required items is not set, skip this entry
    if (!isset($data['page_callback']) || !isset($data['page_type']) || !isset($data['page_id'])) {
      continue;
    }
    if (BOOST_FLUSH_ALL_MULTISITE) {
      $result = db_query("SELECT page_callback, page_type, page_id, base_dir FROM {boost_cache_relationships} WHERE child_page_id = '%s' AND child_page_type = '%s' AND child_page_callback = '%s'", $data['page_id'], $data['page_type'], $data['page_callback']);
    }
    else {
      $data['base_dir'] = isset($data['base_dir']) ? $data['base_dir'] : BOOST_FILE_PATH;
      $result = db_query("SELECT page_callback, page_type, page_id, base_dir FROM {boost_cache_relationships} WHERE child_page_id = '%s' AND child_page_type = '%s' AND child_page_callback = '%s' AND base_dir = '%s'", $data['page_id'], $data['page_type'], $data['page_callback'], $data['base_dir']);
    }
    while ($info = db_fetch_array($result)) {
      $hash = 'relationship base:' . $info['base_dir'] . ' ' . $info['page_callback'] . ' ' . $info['page_type'] . ' ' . $info['page_id'];
      $results[$hash] = $info;
    }
  }
  return $results;
}