You are here

public static function NameFieldSettingsTrait::validateTitleOptions in Name Field 8

Helper function to validate minimum components.

Parameters

array $element: Element being validated.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

File

src/Traits/NameFieldSettingsTrait.php, line 374

Class

NameFieldSettingsTrait
Name settings trait.

Namespace

Drupal\name\Traits

Code

public static function validateTitleOptions($element, FormStateInterface $form_state) {
  $values = static::extractAllowedValues($element['#value']);
  $max_length = $form_state
    ->getValue([
    'settings',
    'max_length',
    'title',
  ]);
  static::validateOptions($element, $form_state, $values, $max_length);
}