You are here

public function FlowControllerBase::getPreviewType in CMS Content Sync 2.1.x

Get the preview type.

Parameters

$entity_type_name:

$bundle_name:

Return value

string

File

src/Controller/FlowControllerBase.php, line 400

Class

FlowControllerBase

Namespace

Drupal\cms_content_sync\Controller

Code

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