W3cubDocs

/Drupal 8

public function CacheCollector::__construct

public CacheCollector::__construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, array $tags = array())

Constructs a CacheCollector object.

Parameters

string $cid: The cid for the array being cached.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.

\Drupal\Core\Lock\LockBackendInterface $lock: The lock backend.

array $tags: (optional) The tags to specify for the cache item.

File

core/lib/Drupal/Core/Cache/CacheCollector.php, line 113

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, array $tags = array()) {
  assert('\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)', 'Cache tags must be strings.');
  $this->cid = $cid;
  $this->cache = $cache;
  $this->tags = $tags;
  $this->lock = $lock;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!CacheCollector.php/function/CacheCollector::__construct/8.1.x