You are here

public static function Kanban::isValidContentModerationWorkflow in Content Planner 8

Checks if a given workflow is a valid Content Moderation workflow.

Parameters

\Drupal\workflows\Entity\Workflow $workflow: The workflow service.

Return value

bool Returns TRUE if the workflow is valid, FALSE otherwise.

2 calls to Kanban::isValidContentModerationWorkflow()
Kanban::__construct in modules/content_kanban/src/Component/Kanban.php
Constructor for the Kanban class.
KanbanController::showKanbans in modules/content_kanban/src/Controller/KanbanController.php
Show Kanbans.

File

modules/content_kanban/src/Component/Kanban.php, line 167

Class

Kanban
The main Kanban class.

Namespace

Drupal\content_kanban\Component

Code

public static function isValidContentModerationWorkflow(Workflow $workflow) {
  if ($workflow
    ->get('type') == 'content_moderation') {
    $type_settings = $workflow
      ->get('type_settings');
    if (!empty($type_settings['entity_types'])) {
      if (array_key_exists('states', $type_settings)) {
        if (!empty($type_settings['states'])) {
          return TRUE;
        }
      }
    }
  }
  return FALSE;
}