// static::getEntityLabels().
$element['#default_value'
] =
[$element['#default_value'
]];
} if ($element['#default_value'
]) { if (!
(reset($element['#default_value'
]) instanceof EntityInterface
)) { throw new \
InvalidArgumentException('The #default_value property has to be an entity object or an array of entity objects.'
);
} // Extract the labels from the passed-in entity objects, taking access
// checks into account.
return static::
getEntityLabels($element['#default_value'
]);
} } // Potentially the #value is set directly, so it contains the 'target_id'
// array structure instead of a string.
if ($input !== FALSE &&
is_array($input)) { $entity_ids =
array_map(function Darray
$item) { return $item['target_id'
];
},
$input);
$entities = \Drupal::
entityTypeManager()->
getStorage($element['#target_type'
])->
loadMultiple($entity_ids);