You are here

class SettableStorageComparer in Configuration Synchronizer 8.2

Defines a settable config storage comparer.

Hierarchy

Expanded class hierarchy of SettableStorageComparer

1 file declares its use of SettableStorageComparer
ConfigSyncLister.php in src/ConfigSyncLister.php

File

src/Config/SettableStorageComparer.php, line 13

Namespace

Drupal\config_sync\Config
View source
class SettableStorageComparer extends StorageComparer {

  /**
   * Sets the source storage used to discover configuration changes.
   *
   * @param \Drupal\Core\Config\StorageInterface $storage
   *
   * @return $this
   */
  public function setSourceStorage(StorageInterface $storage) {

    // Reset the static configuration data cache.
    $this->sourceCacheStorage
      ->deleteAll();
    $this->sourceNames = [];
    $this->sourceStorage = new CachedStorage($storage, $this->sourceCacheStorage);
    $this->changelist = [
      StorageInterface::DEFAULT_COLLECTION => $this
        ->getEmptyChangelist(),
    ];
    return $this;
  }

  /**
   * Sets the target storage used to discover configuration changes.
   *
   * @param \Drupal\Core\Config\StorageInterface $storage
   *
   * @return $this
   */
  public function setTargetStorage(StorageInterface $storage) {

    // Reset the static configuration data cache.
    $this->targetCacheStorage
      ->deleteAll();
    $this->targetNames = [];
    $this->targetStorage = new CachedStorage($storage, $this->targetCacheStorage);
    $this->changelist = [
      StorageInterface::DEFAULT_COLLECTION => $this
        ->getEmptyChangelist(),
    ];
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
SettableStorageComparer::setSourceStorage public function Sets the source storage used to discover configuration changes.
SettableStorageComparer::setTargetStorage public function Sets the target storage used to discover configuration changes.
StorageComparer::$changelist protected property List of changes to between the source storage and the target storage.
StorageComparer::$sourceCacheStorage protected property A memory cache backend to statically cache source configuration data.
StorageComparer::$sourceNames protected property Sorted list of all the configuration object names in the source storage.
StorageComparer::$sourceStorage protected property The source storage used to discover configuration changes.
StorageComparer::$sourceStorages protected property The source storages keyed by collection.
StorageComparer::$targetCacheStorage protected property A memory cache backend to statically cache target configuration data.
StorageComparer::$targetNames protected property Sorted list of all the configuration object names in the target storage.
StorageComparer::$targetStorage protected property The target storage used to write configuration changes.
StorageComparer::$targetStorages protected property The target storages keyed by collection.
StorageComparer::addChangeList protected function Adds changes to the changelist.
StorageComparer::addChangelistCreate protected function Creates the create changelist.
StorageComparer::addChangelistDelete protected function Creates the delete changelist.
StorageComparer::addChangelistRename protected function Creates the rename changelist.
StorageComparer::addChangelistUpdate protected function Creates the update changelist.
StorageComparer::createChangelist public function
StorageComparer::createRenameName protected function Creates a rename name from the old and new names for the object.
StorageComparer::extractRenameNames public function Extracts old and new configuration names from a configuration change name. Overrides StorageComparerInterface::extractRenameNames
StorageComparer::getAllCollectionNames public function Gets the existing collections from both the target and source storage. Overrides StorageComparerInterface::getAllCollectionNames
StorageComparer::getAndSortConfigData protected function Gets and sorts configuration data from the source and target storages.
StorageComparer::getChangelist public function Gets the list of differences to import. Overrides StorageComparerInterface::getChangelist
StorageComparer::getEmptyChangelist public function Gets an empty changelist. Overrides StorageComparerInterface::getEmptyChangelist
StorageComparer::getSourceStorage public function Gets the configuration source storage. Overrides StorageComparerInterface::getSourceStorage
StorageComparer::getTargetStorage public function Gets the configuration target storage. Overrides StorageComparerInterface::getTargetStorage
StorageComparer::hasChanges public function Checks if there are any operations with changes to process. Overrides StorageComparerInterface::hasChanges
StorageComparer::moveRenameToUpdate public function Moves a rename operation to an update. Overrides StorageComparerInterface::moveRenameToUpdate
StorageComparer::removeFromChangelist protected function Removes the entry from the given operation changelist for the given name.
StorageComparer::reset public function Recalculates the differences. Overrides StorageComparerInterface::reset
StorageComparer::validateSiteUuid public function Validates that the system.site::uuid in the source and target match. Overrides StorageComparerInterface::validateSiteUuid
StorageComparer::__construct public function Constructs the Configuration storage comparer.