You are here

public static function TargetingFormTrait::targetingFormValidate in Doubleclick for Publishers (DFP) 8

Validation function used by the targeting form.

File

src/Form/TargetingFormTrait.php, line 76
Contains \Drupal\dfp\Form\TargetingFormTrait.

Class

TargetingFormTrait
Adds a form for saving DFP targeting information.

Namespace

Drupal\dfp\Form

Code

public static function targetingFormValidate(array &$element, FormStateInterface &$form_state) {
  if ($form_state
    ->getTriggeringElement()['#name'] != 'dfp_more_targets') {
    self::trimTargetingValues($form_state
      ->getValues());
  }
}