You are here

class GhostStorage in Config Filter 8

Same name and namespace in other branches
  1. 8.2 src/Config/GhostStorage.php \Drupal\config_filter\Config\GhostStorage

Class GhostStorage.

A GhostStorage acts like the normal Storage it wraps. All reading operations return the values of the decorated storage but write operations are silently ignored and the ghost pretends that the operation was successful.

@package Drupal\config_filter\Config

Hierarchy

Expanded class hierarchy of GhostStorage

1 file declares its use of GhostStorage
GhostStorageTest.php in src/Tests/GhostStorageTest.php

File

src/Config/GhostStorage.php, line 16

Namespace

Drupal\config_filter\Config
View source
class GhostStorage extends ReadOnlyStorage implements StorageInterface {

  /**
   * {@inheritdoc}
   */
  public function write($name, array $data) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function delete($name) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function rename($name, $new_name) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function deleteAll($prefix = '') {
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GhostStorage::delete public function Deletes a configuration object from the storage. Overrides ReadOnlyStorage::delete
GhostStorage::deleteAll public function Deletes configuration objects whose names start with a given prefix. Overrides ReadOnlyStorage::deleteAll
GhostStorage::rename public function Renames a configuration object in the storage. Overrides ReadOnlyStorage::rename
GhostStorage::write public function Writes configuration data to the storage. Overrides ReadOnlyStorage::write
ReadOnlyStorage::$storage protected property The config storage that we are decorating.
ReadOnlyStorage::createCollection public function Creates a collection on the storage. Overrides StorageInterface::createCollection
ReadOnlyStorage::decode public function Decodes configuration data from the storage-specific format. Overrides StorageInterface::decode
ReadOnlyStorage::encode public function Encodes configuration data into the storage-specific format. Overrides StorageInterface::encode
ReadOnlyStorage::exists public function Returns whether a configuration object exists. Overrides StorageInterface::exists
ReadOnlyStorage::getAllCollectionNames public function Gets the existing collections. Overrides StorageInterface::getAllCollectionNames
ReadOnlyStorage::getCollectionName public function Gets the name of the current collection the storage is using. Overrides StorageInterface::getCollectionName
ReadOnlyStorage::listAll public function Gets configuration object names starting with a given prefix. Overrides StorageInterface::listAll
ReadOnlyStorage::read public function Reads configuration data from the storage. Overrides StorageInterface::read
ReadOnlyStorage::readMultiple public function Reads configuration data from the storage. Overrides StorageInterface::readMultiple
ReadOnlyStorage::__construct public function Create a ReadOnlyStorage decorating another storage.
StorageInterface::DEFAULT_COLLECTION constant The default collection name.