You are here

function _pages_restriction_get_cached_data in Pages Restriction Access 7

Get all the cached data.

Return value

array Array where the key is the id_session and the value is the next page.

2 calls to _pages_restriction_get_cached_data()
pages_restriction_page_alter in ./pages_restriction.module
Implements hook_page_alter().
_pages_restriction_restrict_access in includes/pages_restriction.helpers.inc
Restriction rules feature for Pages Restriction.

File

includes/pages_restriction.cache.inc, line 21
Pages Restrictions cache related functions.

Code

function _pages_restriction_get_cached_data() {
  $caches =& drupal_static(__FUNCTION__);
  if (empty($caches)) {

    // Retrieve all the cached data.
    $cache_raw = db_select('cache_pages_restriction', 'c')
      ->fields('c')
      ->execute()
      ->fetchAll(PDO::FETCH_ASSOC);

    // Define array containing cached data.
    foreach ($cache_raw as $cache) {
      $caches[$cache['id_session']][$cache['restrict_rules']] = $cache['next_page_path'];
    }
  }
  return $caches;
}