An entity-bound allowed values callback.
function options_test_dynamic_values_callback($field, $instance, EntityInterface $entity, &$cacheable) {
$cacheable = FALSE;
// We need the values of the entity as keys.
$uri = $entity
->uri();
return drupal_map_assoc(array(
$entity
->label(),
$uri['path'],
$entity
->uuid(),
$entity
->bundle(),
));
}