You are here

protected function SyncHealth::getLocalVersionDifferences in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x modules/cms_content_sync_health/src/Controller/SyncHealth.php \Drupal\cms_content_sync_health\Controller\SyncHealth::getLocalVersionDifferences()
  2. 2.0.x modules/cms_content_sync_health/src/Controller/SyncHealth.php \Drupal\cms_content_sync_health\Controller\SyncHealth::getLocalVersionDifferences()
1 call to SyncHealth::getLocalVersionDifferences()
SyncHealth::overview in modules/cms_content_sync_health/src/Controller/SyncHealth.php
Render the overview page.

File

modules/cms_content_sync_health/src/Controller/SyncHealth.php, line 421

Class

SyncHealth
Provides a listing of Flow.

Namespace

Drupal\cms_content_sync_health\Controller

Code

protected function getLocalVersionDifferences() {
  $result = [];
  foreach (Flow::getAll() as $flow) {
    foreach ($flow
      ->getEntityTypeConfig(NULL, NULL, TRUE) as $id => $config) {
      $type_name = $config['entity_type_name'];
      $bundle_name = $config['bundle_name'];
      $version = $config['version'];
      $current = Flow::getEntityTypeVersion($type_name, $bundle_name);
      if ($version == $current) {
        continue;
      }
      $result[] = $flow
        ->label() . ' uses entity type  ' . $type_name . '.' . $bundle_name . ' with version ' . $version . '. Current version is ' . $current . '. Please update the Flow.';
    }
  }
  return $result;
}