/**
* {@inheritdoc}
*/
public function toArray() { $properties =
[];
/** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type */
$entity_type =
$this->
getEntityType();
$id_key =
$entity_type->
getKey('id'
);
$property_names =
$entity_type->
getPropertiesToExport($this->
id());
if (empty($property_names)) { throw new SchemaIncompleteException(sprintf("Entity type '%s' is missing 'config_export' definition in its annotation",
$entity_type->
getClass()));
} foreach ($property_names as $property_name =>
$export_name) { // Special handling for IDs so that computed compound IDs work.
// @see \Drupal\Core\Entity\EntityDisplayBase::id()
if ($property_name ==
$id_key) { $properties[$export_name] =
$this->
id();
} else { $properties[$export_name] =
$this->
get($property_name);
} }