You are here

protected function EdgeEntityStorageBase::createNewInstance in Apigee Edge 8

Creates a new Drupal entity from an SDK entity.

Parameters

\Apigee\Edge\Entity\EntityInterface $sdk_entity: An SDK entity.

Return value

\Drupal\apigee_edge\Entity\EdgeEntityInterface The Drupal entity that decorates the SDK entity.

1 call to EdgeEntityStorageBase::createNewInstance()
EdgeEntityStorageBase::processLoadedEntities in src/Entity/Storage/EdgeEntityStorageBase.php
Processes loaded (SDK) entities to Drupal entities.

File

src/Entity/Storage/EdgeEntityStorageBase.php, line 233

Class

EdgeEntityStorageBase
Base entity storage class for Apigee Edge entities.

Namespace

Drupal\apigee_edge\Entity\Storage

Code

protected function createNewInstance(SdkEntityInterface $sdk_entity) : DrupalEdgeEntityInterface {
  $rc = new \ReflectionClass($this->entityClass);
  $rm = $rc
    ->getMethod('createFrom');
  return $rm
    ->invoke(NULL, $sdk_entity);
}