You are here

function paragraphs_item_get_host_entity in Paragraphs 7

Entity property info getter callback for the host entity property.

As the property is of type 'entity', we have to return a wrapped entity.

1 string reference to 'paragraphs_item_get_host_entity'
ParagraphsItemMetadataController::entityPropertyInfo in ./ParagraphsItemMetadataController.inc
Generate basic metadata for a paragraphs item.

File

./paragraphs.module, line 1052
Paragraphs hooks and common functions.

Code

function paragraphs_item_get_host_entity($item) {

  // We need to call hostEntity() first, because it sets the hostEntityType.
  $entity = $item
    ->hostEntity();
  return entity_metadata_wrapper($item
    ->hostEntityType(), $entity);
}