You are here

class DomainConfigLibraryDiscoveryCollector in Domain Access 8

Class DomainConfigLibraryDiscoveryCollector.

@package Drupal\domain_config

Hierarchy

Expanded class hierarchy of DomainConfigLibraryDiscoveryCollector

1 string reference to 'DomainConfigLibraryDiscoveryCollector'
domain_config.services.yml in domain_config/domain_config.services.yml
domain_config/domain_config.services.yml
1 service uses DomainConfigLibraryDiscoveryCollector
domain_config.library.discovery.collector in domain_config/domain_config.services.yml
\Drupal\domain_config\DomainConfigLibraryDiscoveryCollector

File

domain_config/src/DomainConfigLibraryDiscoveryCollector.php, line 13

Namespace

Drupal\domain_config
View source
class DomainConfigLibraryDiscoveryCollector extends LibraryDiscoveryCollector {

  /**
   * The active domain.
   *
   * @var \Drupal\domain\DomainInterface
   */
  protected $domain;

  /**
   * Set a domain.
   *
   * @param \Drupal\domain\DomainNegotiatorInterface $domainNegotiator
   *   The domain negotiator.
   */
  public function setDomainNegotiator(DomainNegotiatorInterface $domainNegotiator) {
    $this->domain = $domainNegotiator
      ->getActiveDomain();
  }

  /**
   * {@inheritdoc}
   */
  protected function getCid() {
    if (!isset($this->cid)) {
      $domain_id = 'null';
      if (!empty($this->domain)) {
        $domain_id = $this->domain
          ->id();
      }
      $this->cid = 'library_info:' . $domain_id . ':' . $this->themeManager
        ->getActiveTheme()
        ->getName();
    }
    return $this->cid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheCollector::$cache protected property The cache backend that should be used. 1
CacheCollector::$cacheCreated protected property Stores the cache creation time.
CacheCollector::$cacheInvalidated protected property Flag that indicates of the cache has been invalidated.
CacheCollector::$cacheLoaded protected property Indicates if the collected cache was already loaded.
CacheCollector::$cid protected property The cache id that is used for the cache entry.
CacheCollector::$keysToPersist protected property An array of keys to add to the cache on service termination.
CacheCollector::$keysToRemove protected property An array of keys to remove from the cache on service termination.
CacheCollector::$lock protected property The lock backend that should be used. 1
CacheCollector::$storage protected property Storage for the data itself.
CacheCollector::$tags protected property A list of tags that are used for the cache entry.
CacheCollector::clear public function Clears the collected cache entry. Overrides CacheCollectorInterface::clear 1
CacheCollector::delete public function Deletes the element. Overrides CacheCollectorInterface::delete
CacheCollector::destruct public function Performs destruct operations. Overrides DestructableInterface::destruct
CacheCollector::get public function Gets value from the cache. Overrides CacheCollectorInterface::get 2
CacheCollector::has public function Returns whether data exists for this key. Overrides CacheCollectorInterface::has 1
CacheCollector::invalidateCache protected function Invalidate the cache.
CacheCollector::lazyLoadCache protected function Loads the cache if not already done. 1
CacheCollector::normalizeLockName protected function Normalizes a cache ID in order to comply with database limitations.
CacheCollector::persist protected function Flags an offset value to be written to the persistent cache.
CacheCollector::set public function Implements \Drupal\Core\Cache\CacheCollectorInterface::set(). Overrides CacheCollectorInterface::set 1
CacheCollector::updateCache protected function Writes a value to the persistent cache immediately. 1
DomainConfigLibraryDiscoveryCollector::$domain protected property The active domain.
DomainConfigLibraryDiscoveryCollector::getCid protected function Gets the cache ID. Overrides LibraryDiscoveryCollector::getCid
DomainConfigLibraryDiscoveryCollector::setDomainNegotiator public function Set a domain.
LibraryDiscoveryCollector::$discoveryParser protected property The library discovery parser.
LibraryDiscoveryCollector::$themeManager protected property The theme manager.
LibraryDiscoveryCollector::applyLibrariesExtend protected function Applies the libraries-extend specified by the active theme.
LibraryDiscoveryCollector::getLibraryDefinitions protected function Returns the library definitions for a given extension.
LibraryDiscoveryCollector::reset public function Resets the local cache. Overrides CacheCollector::reset
LibraryDiscoveryCollector::resolveCacheMiss protected function Resolves a cache miss. Overrides CacheCollector::resolveCacheMiss
LibraryDiscoveryCollector::__construct public function Constructs a CacheCollector object. Overrides CacheCollector::__construct