40 if (isset($this->fields[$type][
$subtype])) {
44 $entity_class = $this->entityTable->getEntityClass($type, $subtype);
45 $defaults = !empty($entity_class) ? $entity_class::getDefaultFields() : [];
47 $result = (array) $this->events->triggerResults(
'fields',
"{$type}:{$subtype}", [
49 'subtype' => $subtype,
55 if (empty($field[
'name']) || empty($field[
'#type'])) {
56 $this->
getLogger()->warning(
"Field config for '{$type}:{$subtype}' is missing 'name' or '#type' in field: " . print_r($field,
true));
60 if (!isset($field[
'#label'])) {
61 $label_key =
"fields:{$type}:{$subtype}:{$field['name']}";
62 if ($this->translator->languageKeyExists($label_key)) {
63 $field[
'#label'] = $this->translator->translate($label_key);
trait Loggable
Enables adding a logger.
getLogger()
Returns logger.
Entity table database service.