You are here

public function Flow::getUsedPoolsForPulling in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Flow.php \Drupal\cms_content_sync\Entity\Flow::getUsedPoolsForPulling()

Get a list of all pools that are used for pushing this entity, either automatically or manually selected.

Parameters

string $entity_type:

string $bundle:

Return value

Pool[]

File

src/Entity/Flow.php, line 330

Class

Flow
Defines the "Content Sync - Flow" entity.

Namespace

Drupal\cms_content_sync\Entity

Code

public function getUsedPoolsForPulling($entity_type, $bundle) {
  $config = $this
    ->getEntityTypeConfig($entity_type, $bundle);
  if (empty($config['import_pools'])) {
    return [];
  }
  $result = [];
  $pools = Pool::getAll();
  foreach ($config['import_pools'] as $id => $setting) {
    $pool = $pools[$id];
    if (Pool::POOL_USAGE_FORBID == $setting) {
      continue;
    }
    $result[] = $pool;
  }
  return $result;
}