You are here

public function CompanyMembershipObjectCache::__construct in Apigee Edge 8

CompanyMembershipObjectCache constructor.

Parameters

\Drupal\Core\Cache\CacheFactoryInterface $cache_factory: The cache factory.

\Drupal\apigee_edge\MemoryCacheFactoryInterface $memory_cache_factory: The module specific memory cache factory.

\Drupal\Core\Config\ConfigFactoryInterface $config: The config factory.

\Drupal\Component\Datetime\TimeInterface $time: The system time service.

File

modules/apigee_edge_teams/src/CompanyMembershipObjectCache.php, line 88

Class

CompanyMembershipObjectCache
Providers a persistent & non-persistent cache for company membership objects.

Namespace

Drupal\apigee_edge_teams

Code

public function __construct(CacheFactoryInterface $cache_factory, MemoryCacheFactoryInterface $memory_cache_factory, ConfigFactoryInterface $config, TimeInterface $time) {
  $this->persistentCacheBackend = $cache_factory
    ->get(self::DEFAULT_CACHE_BIN);

  // TODO Should we introduce dedicated cache expiration configuration for
  // this?
  $this->persistentCacheExpiration = $config
    ->get('apigee_edge_teams.team_settings')
    ->get('cache_expiration');
  $this->memoryCache = $memory_cache_factory
    ->get('company_membership_object');
  $this->systemTime = $time;
}