You are here

class DepcalcCacheFactory in Dependency Calculation 8

Hierarchy

Expanded class hierarchy of DepcalcCacheFactory

1 string reference to 'DepcalcCacheFactory'
depcalc.services.yml in ./depcalc.services.yml
depcalc.services.yml
1 service uses DepcalcCacheFactory
cache.factory.depcalc in ./depcalc.services.yml
Drupal\depcalc\Cache\DepcalcCacheFactory

File

src/Cache/DepcalcCacheFactory.php, line 8

Namespace

Drupal\depcalc\Cache
View source
class DepcalcCacheFactory implements CacheFactoryInterface {

  /**
   * The core cache factory.
   *
   * @var \Drupal\Core\Cache\CacheFactoryInterface
   */
  protected $factory;

  /**
   * The event dispatcher.
   *
   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
   */
  protected $dispatcher;

  /**
   * DepcalcCacheFactory constructor.
   *
   * @param \Drupal\Core\Cache\CacheFactoryInterface $factory
   *   The core cache factory.
   */
  public function __construct(CacheFactoryInterface $factory, EventDispatcherInterface $dispatcher) {
    $this->factory = $factory;
    $this->dispatcher = $dispatcher;
  }

  /**
   * {@inheritdoc}
   */
  public function get($bin) {
    $backend = $this->factory
      ->get('depcalc');
    return new DepcalcCacheBackend($backend, $this->dispatcher);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DepcalcCacheFactory::$dispatcher protected property The event dispatcher.
DepcalcCacheFactory::$factory protected property The core cache factory.
DepcalcCacheFactory::get public function Gets a cache backend class for a given cache bin. Overrides CacheFactoryInterface::get
DepcalcCacheFactory::__construct public function DepcalcCacheFactory constructor.