You are here

public function VersionComparison::getEntityTypeFromConfig 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::getEntityTypeFromConfig()
  2. 2.1.x modules/cms_content_sync_developer/src/EventSubscriber/VersionComparison.php \Drupal\cms_content_sync_developer\EventSubscriber\VersionComparison::getEntityTypeFromConfig()

Get the entity type.

The entity type is not set consistent between the entity types.

Parameters

$config:

Return value

$entity_type or NULL

2 calls to VersionComparison::getEntityTypeFromConfig()
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 185

Class

VersionComparison
A subscriber triggering a config when certain configuration changes.

Namespace

Drupal\cms_content_sync_developer\EventSubscriber

Code

public function getEntityTypeFromConfig($config) {
  if (isset($config['entity_type'])) {
    $entity_type = $config['entity_type'];
  }
  elseif (isset($config['target_entity_type_id'])) {
    $entity_type = $config['target_entity_type_id'];
  }
  return isset($entity_type) ? $entity_type : NULL;
}