class ChainCacheClearer

ChainCacheClearer.

@author Dustin Dobervich <ddobervich@gmail.com>

Hierarchy

Expanded class hierarchy of ChainCacheClearer

1 file declares its use of ChainCacheClearer
ChainCacheClearerTest.php in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php, line 19

Namespace

Symfony\Component\HttpKernel\CacheClearer
View source
class ChainCacheClearer implements CacheClearerInterface {

  /**
   * @var array $clearers
   */
  protected $clearers;

  /**
   * Constructs a new instance of ChainCacheClearer.
   *
   * @param array $clearers The initial clearers.
   */
  public function __construct(array $clearers = array()) {
    $this->clearers = $clearers;
  }

  /**
   * {@inheritDoc}
   */
  public function clear($cacheDir) {
    foreach ($this->clearers as $clearer) {
      $clearer
        ->clear($cacheDir);
    }
  }

  /**
   * Adds a cache clearer to the aggregate.
   *
   * @param CacheClearerInterface $clearer
   */
  public function add(CacheClearerInterface $clearer) {
    $this->clearers[] = $clearer;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ChainCacheClearer::$clearers protected property
ChainCacheClearer::add public function Adds a cache clearer to the aggregate.
ChainCacheClearer::clear public function Clears any caches necessary. Overrides CacheClearerInterface::clear
ChainCacheClearer::__construct public function Constructs a new instance of ChainCacheClearer.