You are here

protected function SyncHealth::getLocalVersionDifferences in CMS Content Sync 2.1.x

Same name and namespace in other branches
  1. 8 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
      ->getController()
      ->getEntityTypeConfig(NULL, NULL, TRUE) as $type_name => $bundles) {
      foreach ($bundles as $bundle_name => $config) {
        $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;
}