You are here

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

Check if the given pool is used by this Flow. If any handler set the flow as FORCE or ALLOW, this will return TRUE.

Parameters

Pool $pool:

Return value

bool

1 call to FlowControllerBase::usesPool()
FlowControllerBase::getUsedPools in src/Controller/FlowControllerBase.php
Get a list of all pools this Flow is using.
1 method overrides FlowControllerBase::usesPool()
FlowControllerSimple::usesPool in src/Controller/FlowControllerSimple.php
Check if the given pool is used by this Flow. If any handler set the flow as FORCE or ALLOW, this will return TRUE.

File

src/Controller/FlowControllerBase.php, line 238

Class

FlowControllerBase

Namespace

Drupal\cms_content_sync\Controller

Code

public function usesPool($pool) {
  foreach ($this
    ->getEntityTypeConfig(null, null, true) as $bundles) {
    foreach ($bundles as $config) {
      if (Flow::HANDLER_IGNORE == $config['handler']) {
        continue;
      }
      if (PushIntent::PUSH_DISABLED != $config['export']) {
        if (!empty($config['export_pools'][$pool->id]) && Pool::POOL_USAGE_FORBID != $config['export_pools'][$pool->id]) {
          return true;
        }
      }
      if (PullIntent::PULL_DISABLED != $config['import']) {
        if (!empty($config['import_pools'][$pool->id]) && Pool::POOL_USAGE_FORBID != $config['import_pools'][$pool->id]) {
          return true;
        }
      }
    }
  }
  return false;
}