You are here

public function AddressItem::getProperties in Address 8

Gets an array of property objects.

Parameters

bool $include_computed: If set to TRUE, computed properties are included. Defaults to FALSE.

Return value

\Drupal\Core\TypedData\TypedDataInterface[] An array of property objects implementing the TypedDataInterface, keyed by property name.

Throws

\Drupal\Core\TypedData\Exception\MissingDataException If the complex data structure is unset and no property can be created.

Overrides Map::getProperties

File

src/Plugin/Field/FieldType/AddressItem.php, line 141

Class

AddressItem
Plugin implementation of the 'address' field type.

Namespace

Drupal\address\Plugin\Field\FieldType

Code

public function getProperties($include_computed = FALSE) {
  $properties = parent::getProperties($include_computed);
  $parsed_overrides = new FieldOverrides($this
    ->getFieldOverrides());
  $hidden_properties = array_map(static function ($name) {
    return FieldHelper::getPropertyName($name);
  }, $parsed_overrides
    ->getHiddenFields());
  foreach ($hidden_properties as $hidden_property) {
    unset($properties[$hidden_property]);
  }
  return $properties;
}