You are here

protected function ResourceFieldEntity::entityTypeWrapper in RESTful 7.2

Gets the \EntityStructureWrapper for the entity type.

Return value

mixed The \EntityStructureWrapper if the entity type exists.

1 call to ResourceFieldEntity::entityTypeWrapper()
ResourceFieldEntity::propertyOnEntity in src/Plugin/resource/Field/ResourceFieldEntity.php
Sets the resource field property to the schema field in the entity.

File

src/Plugin/resource/Field/ResourceFieldEntity.php, line 791
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldEntity

Class

ResourceFieldEntity
Class ResourceFieldEntity.

Namespace

Drupal\restful\Plugin\resource\Field

Code

protected function entityTypeWrapper() {
  static $entity_wrappers = array();
  $key = sprintf('%s:%s', $this
    ->getEntityType(), $this
    ->getBundle());
  if (isset($entity_wrappers[$key])) {
    return $entity_wrappers[$key];
  }
  $entity_wrappers[$key] = entity_metadata_wrapper($this
    ->getEntityType(), NULL, array(
    'bundle' => $this
      ->getBundle(),
  ));
  return $entity_wrappers[$key];
}