You are here

public function VersionComparison::getBundleFromConfig in CMS Content Sync 2.1.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::getBundleFromConfig()
  2. 2.0.x modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php \Drupal\cms_content_sync_developer\EventSubscriber\VersionComparison::getBundleFromConfig()

Get the bundle.

The bundle is not set consistent between the entity types.

Parameters

$config:

Return value

$entity_type or NULL

2 calls to VersionComparison::getBundleFromConfig()
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 210

Class

VersionComparison
A subscriber triggering a config when certain configuration changes.

Namespace

Drupal\cms_content_sync_developer\EventSubscriber

Code

public function getBundleFromConfig($config) {
  if (isset($config['bundle'])) {
    $bundle = $config['bundle'];
  }
  elseif (isset($config['target_bundle'])) {
    $bundle = $config['target_bundle'];
  }
  return isset($bundle) ? $bundle : NULL;
}