You are here

public static function PcaAddressElementTrait::processPcaAddress in Loqate 2.x

Same name and namespace in other branches
  1. 8 src/PcaAddressElementTrait.php \Drupal\loqate\PcaAddressElementTrait::processPcaAddress()

Process the PCA address form element.

File

src/PcaAddressElementTrait.php, line 35

Class

PcaAddressElementTrait
Class PcaAddressElementTrait.

Namespace

Drupal\loqate

Code

public static function processPcaAddress(array &$element, FormStateInterface $form_state, array &$complete_form) {

  // Wrap render array in a wrapper before doing anything.
  self::wrapAddressFieldsInit($element);

  // Add a lookup text field.
  self::addAddressLookupField($element);

  // Add a label field for plain text details.
  self::addAddressLabelField($element);

  // Prepare field mapping specification.
  self::preparePcaFieldMapping($element);

  // Prepare and expose options to Drupal Settings.
  self::preparePcaOptions($element);
  return $element;
}