X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fentity_embed%2Fsrc%2FPlugin%2Fentity_embed%2FEntityEmbedDisplay%2FEntityReferenceFieldFormatter.php;fp=web%2Fmodules%2Fcontrib%2Fentity_embed%2Fsrc%2FPlugin%2Fentity_embed%2FEntityEmbedDisplay%2FEntityReferenceFieldFormatter.php;h=318635a51b12e85cf6c163d5f4bf379854fda1dd;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php b/web/modules/contrib/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php new file mode 100644 index 000000000..318635a51 --- /dev/null +++ b/web/modules/contrib/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php @@ -0,0 +1,39 @@ +fieldDefinition)) { + $this->fieldDefinition = parent::getFieldDefinition(); + $this->fieldDefinition->setSetting('target_type', $this->getEntityTypeFromContext()); + } + return $this->fieldDefinition; + } + + /** + * {@inheritdoc} + */ + public function getFieldValue() { + return array('target_id' => $this->getContextValue('entity')->id()); + } + +}