You are here

public function ContentModeration::appliesToEntityTypeAndBundle 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::appliesToEntityTypeAndBundle()

Checks if the workflow applies to the supplied entity type and bundle.

Parameters

string $entity_type_id: The entity type ID to check.

string $bundle_id: The bundle ID to check.

Return value

bool TRUE if the workflow applies to the supplied entity type ID and bundle ID. FALSE if not.

Overrides ContentModerationInterface::appliesToEntityTypeAndBundle

1 call to ContentModeration::appliesToEntityTypeAndBundle()
ContentModeration::addEntityTypeAndBundle in core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php
Add an entity type ID / bundle ID to the workflow.

File

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

Class

ContentModeration
Attaches workflows to content entity types and their bundles.

Namespace

Drupal\content_moderation\Plugin\WorkflowType

Code

public function appliesToEntityTypeAndBundle($entity_type_id, $bundle_id) {
  return in_array($bundle_id, $this
    ->getBundlesForEntityType($entity_type_id), TRUE);
}