You are here

public function Flow::resetVersionWarning in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Entity/Flow.php \Drupal\cms_content_sync\Entity\Flow::resetVersionWarning()
  2. 2.0.x src/Entity/Flow.php \Drupal\cms_content_sync\Entity\Flow::resetVersionWarning()

Unset the flow version warning.

File

src/Entity/Flow.php, line 717

Class

Flow
Defines the "Content Sync - Flow" entity.

Namespace

Drupal\cms_content_sync\Entity

Code

public function resetVersionWarning() {
  $moduleHandler = \Drupal::service('module_handler');
  if ($moduleHandler
    ->moduleExists('cms_content_sync_developer')) {
    $developer_config = \Drupal::service('config.factory')
      ->getEditable('cms_content_sync.developer');
    $mismatching_versions = $developer_config
      ->get('version_mismatch');
    if (!empty($mismatching_versions)) {
      unset($mismatching_versions[$this
        ->id()]);
      $developer_config
        ->set('version_mismatch', $mismatching_versions)
        ->save();
    }
  }
}