protected function ResourceFieldFileEntityReference::buildResourceMetadataItem in RESTful 7.2
Builds a metadata item for a field value.
It will add information about the referenced entity.
Parameters
\EntityMetadataWrapper $wrapper: The wrapper for the referenced file array.
Return value
array The metadata array item.
Overrides ResourceFieldEntity::buildResourceMetadataItem
File
- src/
Plugin/ resource/ Field/ ResourceFieldFileEntityReference.php, line 70 - Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldFileEntityReference.
Class
Namespace
Drupal\restful\Plugin\resource\FieldCode
protected function buildResourceMetadataItem($wrapper) {
$file_array = $wrapper
->value();
/* @var \EntityDrupalWrapper $wrapper */
$wrapper = entity_metadata_wrapper('file', $file_array['fid']);
return parent::buildResourceMetadataItem($wrapper);
}