You are here

protected function TargetingFormTrait::getExistingTargeting in Doubleclick for Publishers (DFP) 8

Returns the current targets.

The default value will be used unless an "input" exists in the form_state variable, in which case that will be used.

2 calls to TargetingFormTrait::getExistingTargeting()
AdminSettings::buildForm in src/Form/AdminSettings.php
Form constructor.
Tag::form in src/Form/Tag.php
Gets the actual form array to be built.

File

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

Class

TargetingFormTrait
Adds a form for saving DFP targeting information.

Namespace

Drupal\dfp\Form

Code

protected function getExistingTargeting(FormStateInterface $form_state, array $targeting = []) {
  $user_input = $form_state
    ->getUserInput();
  if (isset($user_input['targeting'])) {
    $targeting = $user_input['targeting'];
  }
  return $targeting;
}