You are here

public static function QuailApiSettings::get_validation_methods_list in Quail API 8

Returns a list of validation methods.

This is only a list of the machine_name and human_name of the select lists. Use this for populating select lists, radio buttons, and check boxes.

Parameters

array|null $validation_methods: (optional) Providing a valid array of validation methods as returned by QuailApiSettings::get_validation_methods() and it will be properly converted into a validation methods list.

Return value

array An array of validation methods that are supported by this module or extending modules. The array keys are the validation methods machine name and the array value is the human name.

File

src/QuailApiSettings.php, line 483

Class

QuailApiSettings
Class QuailApiSettings.

Namespace

Drupal\quail_api

Code

public static function get_validation_methods_list($validation_methods = NULL) {
  if (is_null($validation_methods)) {
    $validation_methods = static::get_validation_methods();
  }
  $validation_methods_list = [];
  foreach ($validation_methods as $machine_name => $value) {
    if (isset($value['human_name'])) {
      $validation_methods_list[$machine_name] = $value['human_name'];
    }
  }
  return $validation_methods_list;
}