You are here

function _fapi_validation_data in Form API Validation 7

Same name and namespace in other branches
  1. 8 fapi_validation.module \_fapi_validation_data()
  2. 6 fapi_validation.module \_fapi_validation_data()
  3. 7.2 fapi_validation.module \_fapi_validation_data()
2 calls to _fapi_validation_data()
fapi_validation_filters_execute in ./fapi_validation.module
fapi_validation_rules_execute in ./fapi_validation.module

File

./fapi_validation.module, line 128

Code

function _fapi_validation_data($type, $refresh = NULL) {
  static $data = array();
  if (!isset($data[$type]) || !count($data[$type]) || $refresh) {
    foreach (module_implements('fapi_validation_' . $type) as $module) {
      $validations = module_invoke($module, 'fapi_validation_' . $type);
      if (isset($validations) && is_array($validations)) {
        foreach ($validations as $name => $info) {
          $data[$type][$name] = $info;
        }
      }
    }
  }
  return $data[$type];
}