You are here

public function ContentModeration::getBundlesForEntityType in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::getBundlesForEntityType()

Gets any bundles the workflow is applied to for the given entity type.

Parameters

string $entity_type_id: The entity type ID to get the bundles for.

Return value

string[] The bundles of the entity type the workflow is applied to or an empty array if the entity type is not applied to the workflow.

Overrides ContentModerationInterface::getBundlesForEntityType

3 calls to ContentModeration::getBundlesForEntityType()
ContentModeration::appliesToEntityTypeAndBundle in core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php
Checks if the workflow applies to the supplied entity type and bundle.
ContentModeration::calculateDependencies in core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php
Calculates dependencies for the configured plugin.
ContentModeration::onDependencyRemoval in core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php
Informs the plugin that a dependency of the workflow will be deleted.

File

core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php, line 149

Class

ContentModeration
Attaches workflows to content entity types and their bundles.

Namespace

Drupal\content_moderation\Plugin\WorkflowType

Code

public function getBundlesForEntityType($entity_type_id) {
  return isset($this->configuration['entity_types'][$entity_type_id]) ? $this->configuration['entity_types'][$entity_type_id] : [];
}