You are here

function interval_get_intervals in Interval Field 7

Util function to fetch defined intervals

6 calls to interval_get_intervals()
interval_apply_interval in ./interval.module
Applies the interval values to a given date
interval_element_process in ./interval.module
Process function to expand the interval element type.
interval_field_instance_settings_form in ./interval.module
Implements hook_field_instance_settings_form().
interval_format_interval in ./interval.module
Formats an interval
interval_period_options_list in ./interval.module
Returns an options list of all supported interval periods.

... See full list

File

./interval.module, line 409
Defines an interval field @copyright Copyright(c) 2011 Rowlands Group @license GPL v2+ http://www.fsf.org/licensing/licenses/gpl.html @author Lee Rowlands leerowlands at rowlandsgroup dot com

Code

function interval_get_intervals() {
  $intervals =& drupal_static(__FUNCTION__);
  if (!isset($intervals)) {

    // First prime of the static - try cache.
    $cached = cache_get('interval_intervals');
    if ($cached && $cached->data) {
      $intervals = $cached->data;
    }
    else {

      // Non-primed cache too - initialize with module_invoke_all.
      $intervals = module_invoke_all('interval_intervals');

      // Cache them.
      cache_set('interval_intervals', $intervals);
    }
  }
  return $intervals;
}