protected function ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php \Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()
- 9 core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php \Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait::addEntityTypeAndBundleToWorkflow()
Adds an entity type ID / bundle ID to the given workflow.
Parameters
\Drupal\workflows\WorkflowInterface $workflow: A workflow object.
string $entity_type_id: The entity type ID to add.
string $bundle: The bundle ID to add.
File
- core/
modules/ content_moderation/ tests/ src/ Traits/ ContentModerationTestTrait.php, line 99
Class
- ContentModerationTestTrait
- Provides functionality for testing content moderation.
Namespace
Drupal\Tests\content_moderation\TraitsCode
protected function addEntityTypeAndBundleToWorkflow(WorkflowInterface $workflow, $entity_type_id, $bundle) {
$workflow
->getTypePlugin()
->addEntityTypeAndBundle($entity_type_id, $bundle);
$workflow
->save();
}