You are here

function ds_static_variables in Display Suite 6

Same name and namespace in other branches
  1. 6.3 ds.module \ds_static_variables()
  2. 6.2 ds.module \ds_static_variables()

Set or get static variables at runtime.

2 calls to ds_static_variables()
ds_regiontoblock::block_view in plugins/ds_regiontoblock.inc
plugin block view
ds_regiontoblock::execute in plugins/ds_regiontoblock.inc
execute().

File

./ds.module, line 126

Code

function ds_static_variables($key, $data = NULL) {
  static $variables = array();
  if (!isset($data) && isset($key) && isset($variables[$key])) {
    return $variables[$key];
  }
  elseif (!isset($variables[$key]) && isset($data)) {
    $variables[$key] = array();
    $variables[$key][] = $data;
  }
  elseif (isset($variables[$key]) && isset($data)) {
    $variables[$key][] = $data;
  }
}