You are here

public function TeamAppEdgeEntityControllerProxy::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

modules/apigee_edge_teams/src/Entity/Controller/TeamAppEdgeEntityControllerProxy.php, line 68

Class

TeamAppEdgeEntityControllerProxy
Team app specific entity controller implementation.

Namespace

Drupal\apigee_edge_teams\Entity\Controller

Code

public function create(EntityInterface $entity) : void {

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

    // Sanity check.
    throw new RuntimeException('Company name has to set on the app.');
  }
  $controller = $this->teamAppControllerFactory
    ->teamAppController($entity
    ->getCompanyName());
  $controller
    ->create($entity);
}