You are here

final class DeveloperAppControllerFactory in Apigee Edge 8

Developer app controller factory.

Hierarchy

Expanded class hierarchy of DeveloperAppControllerFactory

1 string reference to 'DeveloperAppControllerFactory'
apigee_edge.services.yml in ./apigee_edge.services.yml
apigee_edge.services.yml
1 service uses DeveloperAppControllerFactory
apigee_edge.controller.developer_app_controller_factory in ./apigee_edge.services.yml
Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactory

File

src/Entity/Controller/DeveloperAppControllerFactory.php, line 31

Namespace

Drupal\apigee_edge\Entity\Controller
View source
final class DeveloperAppControllerFactory implements DeveloperAppControllerFactoryInterface {

  /**
   * Internal cache for created instances.
   *
   * @var \Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerInterface[]
   */
  private $instances = [];

  /**
   * The SDK connector service.
   *
   * @var \Drupal\apigee_edge\SDKConnectorInterface
   */
  private $connector;

  /**
   * The organization controller service.
   *
   * @var \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface
   */
  private $orgController;

  /**
   * The app cache that stores apps by their ids (UUIDs).
   *
   * @var \Drupal\apigee_edge\Entity\Controller\Cache\AppCacheInterface
   */
  private $appCache;

  /**
   * The app cache by owner factory service.
   *
   * @var \Drupal\apigee_edge\Entity\Controller\Cache\AppCacheByOwnerFactoryInterface
   */
  private $appCacheByOwnerFactory;

  /**
   * The app name cache by owner factory service.
   *
   * @var \Drupal\apigee_edge\Entity\Controller\Cache\AppNameCacheByOwnerFactoryInterface
   */
  private $appNameCacheByOwnerFactory;

  /**
   * DeveloperAppControllerFactory constructor.
   *
   * @param \Drupal\apigee_edge\SDKConnectorInterface $connector
   *   The SDK connector service.
   * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller
   *   The organization controller service.
   * @param \Drupal\apigee_edge\Entity\Controller\Cache\AppCacheInterface $app_cache
   *   The app cache that stores apps by their ids (UUIDs).
   * @param \Drupal\apigee_edge\Entity\Controller\Cache\AppCacheByOwnerFactoryInterface $app_by_owner_app_cache_factory
   *   The app cache by owner factory service.
   * @param \Drupal\apigee_edge\Entity\Controller\Cache\AppNameCacheByOwnerFactoryInterface $app_by_owner_app_id_cache_factory
   *   The app name cache by owner factory service.
   */
  public function __construct(SDKConnectorInterface $connector, OrganizationControllerInterface $org_controller, AppCacheInterface $app_cache, AppCacheByOwnerFactoryInterface $app_by_owner_app_cache_factory, AppNameCacheByOwnerFactoryInterface $app_by_owner_app_id_cache_factory) {
    $this->connector = $connector;
    $this->orgController = $org_controller;
    $this->appCache = $app_cache;
    $this->appCacheByOwnerFactory = $app_by_owner_app_cache_factory;
    $this->appNameCacheByOwnerFactory = $app_by_owner_app_id_cache_factory;
  }

  /**
   * {@inheritdoc}
   */
  public function developerAppController(string $developer) : DeveloperAppControllerInterface {
    if (!isset($this->instances[$developer])) {
      $this->instances[$developer] = new DeveloperAppController($developer, $this->connector, $this->orgController, $this->appCache, $this->appCacheByOwnerFactory, $this->appNameCacheByOwnerFactory);
    }
    return $this->instances[$developer];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeveloperAppControllerFactory::$appCache private property The app cache that stores apps by their ids (UUIDs).
DeveloperAppControllerFactory::$appCacheByOwnerFactory private property The app cache by owner factory service.
DeveloperAppControllerFactory::$appNameCacheByOwnerFactory private property The app name cache by owner factory service.
DeveloperAppControllerFactory::$connector private property The SDK connector service.
DeveloperAppControllerFactory::$instances private property Internal cache for created instances.
DeveloperAppControllerFactory::$orgController private property The organization controller service.
DeveloperAppControllerFactory::developerAppController public function Returns a preconfigured developer app controller. Overrides DeveloperAppControllerFactoryInterface::developerAppController
DeveloperAppControllerFactory::__construct public function DeveloperAppControllerFactory constructor.