You are here

public function VersionComparison::setMismatchingFlows in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php \Drupal\cms_content_sync_developer\EventSubscriber\VersionComparison::setMismatchingFlows()
  2. 2.1.x modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php \Drupal\cms_content_sync_developer\EventSubscriber\VersionComparison::setMismatchingFlows()

Set current mismatching flows.

Parameters

$mismatching_flows:

2 calls to VersionComparison::setMismatchingFlows()
VersionComparison::doComparisonOnCreate in modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php
Check for config changes on create.
VersionComparison::doComparisonOnDelete in modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php
Check for config changes on delete.

File

modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php, line 160

Class

VersionComparison
A subscriber triggering a config when certain configuration changes.

Namespace

Drupal\cms_content_sync_developer\EventSubscriber

Code

public function setMismatchingFlows($mismatching_flows) {
  $config = $this->config_factory;
  $developer_config = $config
    ->getEditable('cms_content_sync.developer');
  $version_mismatch_config = $developer_config
    ->get('version_mismatch');
  if (empty($version_mismatch_config)) {
    $developer_config
      ->set('version_mismatch', $mismatching_flows);
  }
  else {
    $new_mismatching_config = array_unique(array_merge($mismatching_flows, $version_mismatch_config));
    $developer_config
      ->set('version_mismatch', $new_mismatching_config);
  }
  $developer_config
    ->save();
}