You are here

public static function AuthcacheP13nObjectResourcePreprocessor::processValue in Authenticated User Page Caching (Authcache) 7.2

Detect a value resource and add defaults.

File

modules/authcache_p13n/includes/AuthcacheP13nObjectResourcePreprocessor.inc, line 107
Defines the class AuthcacheP13nObjectResourcePreprocessor.

Class

AuthcacheP13nObjectResourcePreprocessor
A utility class suitable for preparing resources for the object factory.

Code

public static function processValue($resource) {
  if (!is_array($resource)) {
    return array(
      '#type' => 'value',
      '#value' => $resource,
    );
  }
  if (isset($resource['#value'])) {
    return $resource + array(
      '#type' => 'value',
    );
  }
}