ProCacheStatic::getCacheClearBehaviors()

Get the cache clearing behaviors for all templates or a given template

If given no arguments, returns array in this format:


$returnValue = [
  'template-name' => [
     // one or more of these:
     CACHE_CLEAR_[BEHAVIOR] => CACHE_CLEAR_[BEHAVIOR],
     CACHE_CLEAR_PAGES => array(123,456,789),
     CACHE_CLEAR_SELECTOR => "selector string",
  ],
  'template-name' => [
     // behaviors
  ],
];

If given a template, then just the single dimensional array is returned containing
only the behvaiors.

Usage

// basic usage
$array = $proCacheStatic->getCacheClearBehaviors();

// usage with all arguments
$array = $proCacheStatic->getCacheClearBehaviors($options = []);

Arguments

NameType(s)Description
$options (optional)null Template string int array

Specify any of the following options:

  • page (Page): Page to get cache behaviors for. You can use either this or template option (no need for both).
  • template (Template): Page template to retrieve behaviors for. Omit to retrieve for all cached templates.
  • cacheClearCustom (string): Value to use for cacheClearCustom setting rather than default.
  • onlyCustom (bool): Return behaviors for templates that are customized differently fron the defaults? Default:false
  • verbose (bool): Get verbose data array? Default:false
  • indexType (string): Type of index to use on returned array, 'value', 'abbr', 'name' Default:'value'

Return value

array


ProCacheStatic methods and properties

API reference based on ProcessWire core version 3.0.251