You are here

final class CompanyMembersControllerFactory in Apigee Edge 8

Factory service that builds a company members controller.

@internal You should use the team membership manager service instead of this.

Hierarchy

Expanded class hierarchy of CompanyMembersControllerFactory

1 string reference to 'CompanyMembersControllerFactory'
apigee_edge_teams.services.yml in modules/apigee_edge_teams/apigee_edge_teams.services.yml
modules/apigee_edge_teams/apigee_edge_teams.services.yml
1 service uses CompanyMembersControllerFactory
apigee_edge_teams.company_members_controller_factory in modules/apigee_edge_teams/apigee_edge_teams.services.yml
Drupal\apigee_edge_teams\CompanyMembersControllerFactory

File

modules/apigee_edge_teams/src/CompanyMembersControllerFactory.php, line 30

Namespace

Drupal\apigee_edge_teams
View source
final class CompanyMembersControllerFactory implements CompanyMembersControllerFactoryInterface {

  /**
   * Internal cache for created instances.
   *
   * @var \Drupal\apigee_edge_teams\CompanyMembersControllerInterface[]
   */
  private $instances = [];

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

  /**
   * The company membership object cache.
   *
   * @var \Drupal\apigee_edge_teams\CompanyMembershipObjectCacheInterface
   */
  private $companyMembershipObjectCache;

  /**
   * CompanyMembersControllerFactory constructor.
   *
   * @param \Drupal\apigee_edge\SDKConnectorInterface $connector
   *   The SDK connector service.
   * @param \Drupal\apigee_edge_teams\CompanyMembershipObjectCacheInterface $company_membership_object_cache
   *   The company membership object cache.
   */
  public function __construct(SDKConnectorInterface $connector, CompanyMembershipObjectCacheInterface $company_membership_object_cache) {
    $this->connector = $connector;
    $this->companyMembershipObjectCache = $company_membership_object_cache;
  }

  /**
   * {@inheritdoc}
   */
  public function companyMembersController(string $company) : CompanyMembersControllerInterface {
    if (!isset($this->instances[$company])) {
      $this->instances[$company] = new CompanyMembersController($company, $this->connector, $this->companyMembershipObjectCache);
    }
    return $this->instances[$company];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CompanyMembersControllerFactory::$companyMembershipObjectCache private property The company membership object cache.
CompanyMembersControllerFactory::$connector private property The SDK connector service.
CompanyMembersControllerFactory::$instances private property Internal cache for created instances.
CompanyMembersControllerFactory::companyMembersController public function Returns a preconfigured company members controller. Overrides CompanyMembersControllerFactoryInterface::companyMembersController
CompanyMembersControllerFactory::__construct public function CompanyMembersControllerFactory constructor.