public function Flow::getPreviewType in CMS Content Sync 8
Same name and namespace in other branches
- 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\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'];
}