public function getUiDefinitions() { $definitions =
$this->
getDefinitions();
// Filter out definitions that can not be configured in Field UI.
$definitions =
array_filter($definitions,
function D
$definition) { return empty($definition['no_ui'
]);
});
// Add preconfigured definitions.
foreach ($definitions as $id =>
$definition) { if (is_subclass_of($definition['class'
], '\Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface'
)) { foreach ($this->
getPreconfiguredOptions($definition['id'
]) as $key =>
$option) { $definitions["field_ui:
$id:
$key"
] =
array_intersect_key( $option,
['label' => 0, 'category' => 1
] ) +
$definition;
} } } return $definitions;
}