You are here

public function ContentModeration::workflowHasData in Drupal 10

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

File

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

Class

ContentModeration
Attaches workflows to content entity types and their bundles.

Namespace

Drupal\content_moderation\Plugin\WorkflowType

Code

public function workflowHasData(WorkflowInterface $workflow) {
  return (bool) $this->entityTypeManager
    ->getStorage('content_moderation_state')
    ->getQuery()
    ->condition('workflow', $workflow
    ->id())
    ->count()
    ->accessCheck(FALSE)
    ->range(0, 1)
    ->execute();
}