You are here

public static function EntityMatcher::elementValidateFilter in Linkit 8.5

Same name and namespace in other branches
  1. 8.4 src/Plugin/Linkit/Matcher/EntityMatcher.php \Drupal\linkit\Plugin\Linkit\Matcher\EntityMatcher::elementValidateFilter()

Form element validation handler; Filters the #value property of an element.

File

src/Plugin/Linkit/Matcher/EntityMatcher.php, line 314

Class

EntityMatcher
Provides default linkit matchers for all entity types.

Namespace

Drupal\linkit\Plugin\Linkit\Matcher

Code

public static function elementValidateFilter(&$element, FormStateInterface $form_state) {
  $element['#value'] = array_filter($element['#value']);
  $form_state
    ->setValueForElement($element, $element['#value']);
}