Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / entity_reference_revisions / src / Plugin / Field / FieldFormatter / EntityReferenceRevisionsFormatterBase.php
1 <?php
2
3 namespace Drupal\entity_reference_revisions\Plugin\Field\FieldFormatter;
4
5 use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase;
6
7 /**
8  * Parent plugin for entity reference formatters.
9  */
10 abstract class EntityReferenceRevisionsFormatterBase extends EntityReferenceFormatterBase {
11
12   /**
13    * {@inheritdoc}
14    */
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) {
22
23         if ($item->entity) {
24           $item->_loaded = TRUE;
25         }
26       }
27     }
28   }
29
30 }