You are here

public function KanbanStatisticService::getWorkflowStateContentCount in Content Planner 8

Get the content count of a given workflow state.

Parameters

string $workflow_id: The workflow ID.

string $state_id: The state ID.

Return value

mixed Returns the workflow state content count.

1 call to KanbanStatisticService::getWorkflowStateContentCount()
KanbanStatisticService::getWorkflowStateContentCounts in modules/content_kanban/src/KanbanStatisticService.php
Get content counts from a given Workflow.

File

modules/content_kanban/src/KanbanStatisticService.php, line 68

Class

KanbanStatisticService
Class KanbanStatisticService.

Namespace

Drupal\content_kanban

Code

public function getWorkflowStateContentCount($workflow_id, $state_id) {
  $query = $this->database
    ->select('content_moderation_state_field_data', 'c');
  $query
    ->addField('c', 'id');
  $query
    ->condition('c.workflow', $workflow_id);
  $query
    ->condition('c.moderation_state', $state_id);
  $count_query = $query
    ->countQuery();
  $result = $count_query
    ->execute()
    ->fetchObject();
  return $result->expression;
}