You are here

public function WorkflowCollector::supported in Workbench Moderation to Content Moderation 8.2

1 call to WorkflowCollector::supported()
WorkflowCollector::enabled in src/WorkflowCollector.php

File

src/WorkflowCollector.php, line 160

Class

WorkflowCollector

Namespace

Drupal\wbm2cm

Code

public function supported() {
  foreach ($this->entityTypeManager
    ->getDefinitions() as $id => $entity_type) {
    if ($entity_type
      ->getBundleOf()) {
      $storage = $this->entityTypeManager
        ->getStorage($id);
      foreach ($storage
        ->getQuery()
        ->execute() as $entity_id) {

        /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
        $entity = $storage
          ->load($entity_id);
        if (in_array('workbench_moderation', $entity
          ->getThirdPartyProviders(), TRUE)) {
          (yield $entity_id => $entity);
        }
      }
    }
  }
}