You are here

public function CacheItem::updateMetadata in Flysystem 3.0.x

Same name and namespace in other branches
  1. 8 src/Flysystem/Adapter/CacheItem.php \Drupal\flysystem\Flysystem\Adapter\CacheItem::updateMetadata()
  2. 3.x src/Flysystem/Adapter/CacheItem.php \Drupal\flysystem\Flysystem\Adapter\CacheItem::updateMetadata()
  3. 2.0.x src/Flysystem/Adapter/CacheItem.php \Drupal\flysystem\Flysystem\Adapter\CacheItem::updateMetadata()

Updates the metadata for the item.

Parameters

array $metadata: The array of metadata for the item.

File

src/Flysystem/Adapter/CacheItem.php, line 33

Class

CacheItem
A filesystem item stored in the Drupal cache.

Namespace

Drupal\flysystem\Flysystem\Adapter

Code

public function updateMetadata(array $metadata) {
  static $keys = [
    'size' => TRUE,
    'mimetype' => TRUE,
    'visibility' => TRUE,
    'timestamp' => TRUE,
    'type' => TRUE,
  ];
  $this->metadata = array_intersect_key($metadata, $keys) + $this->metadata;
}