You are here

public function DeveloperAppEdgeEntityControllerProxy::create in Apigee Edge 8

Creates an entity in Apigee Edge.

Applies incoming values from Apigee Edge in $entity.

Parameters

\Apigee\Edge\Entity\EntityInterface $entity: The created entity.

Overrides EdgeEntityControllerInterface::create

File

src/Entity/Controller/DeveloperAppEdgeEntityControllerProxy.php, line 66

Class

DeveloperAppEdgeEntityControllerProxy
Developer app specific entity controller implementation.

Namespace

Drupal\apigee_edge\Entity\Controller

Code

public function create(EntityInterface $entity) : void {

  /** @var \Apigee\Edge\Api\Management\Entity\DeveloperAppInterface $entity */
  if (empty($entity
    ->getDeveloperId())) {

    // Sanity check.
    throw new RuntimeException('Developer id has to set on the app.');
  }
  $controller = $this->devAppControllerFactory
    ->developerAppController($entity
    ->getDeveloperId());
  $controller
    ->create($entity);
}