public function Flow::usesPool in CMS Content Sync 8
Same name and namespace in other branches
- 2.0.x src/Entity/Flow.php \Drupal\cms_content_sync\Entity\Flow::usesPool()
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 Flow::usesPool()
- Flow::getUsedPools in src/
Entity/ Flow.php - Get a list of all pools this Flow is using.
File
- src/
Entity/ Flow.php, line 691
Class
- Flow
- Defines the "Content Sync - Flow" entity.
Namespace
Drupal\cms_content_sync\EntityCode
public function usesPool($pool) {
foreach ($this
->getEntityTypeConfig(null, null, true) 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;
}