public function Flow::getPreviewType in CMS Content Sync 2.0.x
Same name and namespace in other branches
- 8 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 1028
Class
- Flow
- Defines the "Content Sync - Flow" entity.
Namespace
Drupal\cms_content_sync\EntityCode
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'];
}