You are here

final class CachedManagementApiEdgeEntityControllerProxy in Apigee Edge 8

Management API specific cached entity controller implementation.

For those Management API controllers in Drupal that uses an entity cache to reduce the number of API calls sent by Drupal to Apigee Edge.

Hierarchy

Expanded class hierarchy of CachedManagementApiEdgeEntityControllerProxy

3 files declare their use of CachedManagementApiEdgeEntityControllerProxy
ApiProductStorage.php in src/Entity/Storage/ApiProductStorage.php
DeveloperStorage.php in src/Entity/Storage/DeveloperStorage.php
TeamStorage.php in modules/apigee_edge_teams/src/Entity/Storage/TeamStorage.php

File

src/Entity/Controller/CachedManagementApiEdgeEntityControllerProxy.php, line 32

Namespace

Drupal\apigee_edge\Entity\Controller
View source
final class CachedManagementApiEdgeEntityControllerProxy implements EdgeEntityControllerInterface, EntityCacheAwareControllerInterface {

  /**
   * The original cached entity controller.
   *
   * @var \Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface
   */
  private $originalController;

  /**
   * The MGMT API proxy controller created from the original controller.
   *
   * @var \Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy
   */
  private $proxiedController;

  /**
   * CachedManagementApiEdgeEntityControllerProxy constructor.
   *
   * @param \Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface $controller
   *   The entity controller that uses cache.
   */
  public function __construct(EntityCacheAwareControllerInterface $controller) {
    $this->originalController = $controller;
    $this->proxiedController = new ManagementApiEdgeEntityControllerProxy($controller);
  }

  /**
   * {@inheritdoc}
   */
  public function create(EntityInterface $entity) : void {
    $this->proxiedController
      ->create($entity);
  }

  /**
   * {@inheritdoc}
   */
  public function load(string $id) : EntityInterface {
    return $this->proxiedController
      ->load($id);
  }

  /**
   * {@inheritdoc}
   */
  public function update(EntityInterface $entity) : void {
    $this->proxiedController
      ->update($entity);
  }

  /**
   * {@inheritdoc}
   */
  public function delete(string $id) : void {
    $this->proxiedController
      ->delete($id);
  }

  /**
   * {@inheritdoc}
   */
  public function loadAll() : array {
    return $this->proxiedController
      ->loadAll();
  }

  /**
   * {@inheritdoc}
   */
  public function entityCache() : EntityCacheInterface {
    return $this->originalController
      ->entityCache();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CachedManagementApiEdgeEntityControllerProxy::$originalController private property The original cached entity controller.
CachedManagementApiEdgeEntityControllerProxy::$proxiedController private property The MGMT API proxy controller created from the original controller.
CachedManagementApiEdgeEntityControllerProxy::create public function Creates an entity in Apigee Edge. Overrides EdgeEntityControllerInterface::create
CachedManagementApiEdgeEntityControllerProxy::delete public function Removes an entity from Apigee Edge. Overrides EdgeEntityControllerInterface::delete
CachedManagementApiEdgeEntityControllerProxy::entityCache public function Returns the entity cache used by the controller. Overrides EntityCacheAwareControllerInterface::entityCache
CachedManagementApiEdgeEntityControllerProxy::load public function Loads an entity from Apigee Edge. Overrides EdgeEntityControllerInterface::load
CachedManagementApiEdgeEntityControllerProxy::loadAll public function Loads _all_ entities from Apigee Edge. Overrides EdgeEntityControllerInterface::loadAll
CachedManagementApiEdgeEntityControllerProxy::update public function Updates an entity in Apigee Edge. Overrides EdgeEntityControllerInterface::update
CachedManagementApiEdgeEntityControllerProxy::__construct public function CachedManagementApiEdgeEntityControllerProxy constructor.