You are here

public static function Zone::applyDefaults in Address 8

Ensures all keys are set on the provided value.

Parameters

array $value: The value.

Return value

array The modified value.

1 call to Zone::applyDefaults()
Zone::valueCallback in src/Element/Zone.php
Determines how user input is mapped to an element's #value property.

File

src/Element/Zone.php, line 71

Class

Zone
Provides a zone form element.

Namespace

Drupal\address\Element

Code

public static function applyDefaults(array $value) {
  foreach ([
    'label',
    'territories',
  ] as $property) {
    if (!isset($value[$property])) {
      $value[$property] = NULL;
    }
  }
  return $value;
}