You are here

function _fapi_validation_data in Form API Validation 8

Same name and namespace in other branches
  1. 6 fapi_validation.module \_fapi_validation_data()
  2. 7.2 fapi_validation.module \_fapi_validation_data()
  3. 7 fapi_validation.module \_fapi_validation_data()

Helper function that finds all invocations of hooks.

Parameters

string $validation_type:

Return value

mixed

2 calls to _fapi_validation_data()
fapi_validation_filters_execute in ./fapi_validation.module
Function for executing all filters
fapi_validation_validators_execute in ./fapi_validation.module
Function for executing all validators

File

./fapi_validation.module, line 179
Form API validation module

Code

function _fapi_validation_data($validation_type) {
  static $data = array();
  $fapi_validation_type_hook_implementations = Drupal::moduleHandler()
    ->invokeAll('fapi_validation_' . $validation_type);
  if (isset($fapi_validation_type_hook_implementations) && is_array($fapi_validation_type_hook_implementations)) {
    foreach ($fapi_validation_type_hook_implementations as $validation_name => $validation_callback) {
      $data[$validation_type][$validation_name] = $validation_callback;
    }
  }
  return $data[$validation_type];
}