You are here

public function Flow::getPreviewType in CMS Content Sync 8

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

Get the preview type.

Parameters

$entity_type_name:

$bundle_name:

Return value

string

File

src/Entity/Flow.php, line 1010

Class

Flow
Defines the "Content Sync - Flow" entity.

Namespace

Drupal\cms_content_sync\Entity

Code

public function getPreviewType($entity_type_name, $bundle_name) {
  $previews_enabled = ContentSyncSettings::getInstance()
    ->isPreviewEnabled();
  if (!$previews_enabled) {
    return Flow::PREVIEW_DISABLED;
  }
  $key = $entity_type_name . '-' . $bundle_name;
  $settings = $this->sync_entities[$key];
  if (empty($settings['preview'])) {
    return Flow::PREVIEW_DISABLED;
  }
  return $settings['preview'];
}