public function ModerationInformation::getWorkflowForEntityTypeAndBundle in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::getWorkflowForEntityTypeAndBundle()
- 9 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::getWorkflowForEntityTypeAndBundle()
File
- core/
modules/ content_moderation/ src/ ModerationInformation.php, line 191
Class
- ModerationInformation
- General service for moderation-related questions about Entity API.
Namespace
Drupal\content_moderationCode
public function getWorkflowForEntityTypeAndBundle($entity_type_id, $bundle_id) {
$bundles = $this->bundleInfo
->getBundleInfo($entity_type_id);
if (isset($bundles[$bundle_id]['workflow'])) {
return $this->entityTypeManager
->getStorage('workflow')
->load($bundles[$bundle_id]['workflow']);
}
return NULL;
}