You are here

public function FlowControllerBase::getUsedPoolsForPulling in CMS Content Sync 2.1.x

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/Controller/FlowControllerBase.php, line 186

Class

FlowControllerBase

Namespace

Drupal\cms_content_sync\Controller

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;
}