commerce_api-8.x-1.x-dev/src/TypedData/AddressDataDefinition.php
src/TypedData/AddressDataDefinition.php
<?php declare(strict_types=1); namespace Drupal\commerce_api\TypedData; use Drupal\Core\TypedData\ComplexDataDefinitionBase; use Drupal\Core\TypedData\DataDefinition; final class AddressDataDefinition extends ComplexDataDefinitionBase { /** * {@inheritdoc} */ public function getPropertyDefinitions() { $properties = []; $properties['langcode'] = DataDefinition::create('string') ->setLabel(t('The language code.')); $properties['country_code'] = DataDefinition::create('string') ->setLabel(t('The two-letter country code.')); $properties['administrative_area'] = DataDefinition::create('string') ->setLabel(t('The top-level administrative subdivision of the country.')); $properties['locality'] = DataDefinition::create('string') ->setLabel(t('The locality (i.e. city).')); $properties['dependent_locality'] = DataDefinition::create('string') ->setLabel(t('The dependent locality (i.e. neighborhood).')); $properties['postal_code'] = DataDefinition::create('string') ->setLabel(t('The postal code.')); $properties['sorting_code'] = DataDefinition::create('string') ->setLabel(t('The sorting code.')); $properties['address_line1'] = DataDefinition::create('string') ->setLabel(t('The first line of the address block.')); $properties['address_line2'] = DataDefinition::create('string') ->setLabel(t('The second line of the address block.')); $properties['organization'] = DataDefinition::create('string') ->setLabel(t('The organization')); $properties['given_name'] = DataDefinition::create('string') ->setLabel(t('The given name.')); $properties['additional_name'] = DataDefinition::create('string') ->setLabel(t('The additional name.')); $properties['family_name'] = DataDefinition::create('string') ->setLabel(t('The family name.')); return $properties; } }