function hook_field_formatter_prepare_view

Allow formatters to load information for field values being displayed.

This should be used when a formatter needs to load additional information
from the database in order to render a field, for example a reference field
which displays properties of the referenced entities such as name or type.

Unlike most other field hooks, this hook operates on multiple entities. The
$entities, $instances and $items parameters are arrays keyed by entity ID.
For performance reasons, information for all available entities should be
loaded in a single query where possible.

Parameters

$entity_type:
The type of $entity.

$entities:
Array of entities being displayed, keyed by entity ID.

$field:
The field structure for the operation.

$instances:
Array of instance structures for $field for each entity, keyed by entity
ID.

$langcode:
The language the field values are to be shown in. If no language is
provided the current language is used.

$items:
Array of field values for the entities, keyed by entity ID.

$displays:
Array of display settings to use for each entity, keyed by entity ID.

Return value

Changes or additions to field values are done by altering the $items
parameter by reference.