3 namespace Drupal\entity_reference_revisions\Plugin\Field\FieldFormatter;
5 use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase;
8 * Parent plugin for entity reference formatters.
10 abstract class EntityReferenceRevisionsFormatterBase extends EntityReferenceFormatterBase {
15 public function prepareView(array $entities_items) {
16 // Entity revision loading currently has no static/persistent cache and no
17 // multiload. As entity reference checks _loaded, while we don't want to
18 // indicate a loaded entity, when there is none, as it could cause errors,
19 // we actually load the entity and set the flag.
20 foreach ($entities_items as $items) {
21 foreach ($items as $item) {
24 $item->_loaded = TRUE;