public function ScheduledTransitionsUtility::getApplicableBundles in Scheduled Transitions 8
Same name and namespace in other branches
- 2.x src/ScheduledTransitionsUtility.php \Drupal\scheduled_transitions\ScheduledTransitionsUtility::getApplicableBundles()
Get list of entity type/bundles scheduled transitions can work with.
Return value
array Arrays of bundles keyed by entity type.
Overrides ScheduledTransitionsUtilityInterface::getApplicableBundles
1 call to ScheduledTransitionsUtility::getApplicableBundles()
- ScheduledTransitionsUtility::getBundles in src/
ScheduledTransitionsUtility.php - Get list of entity type/bundles scheduled transitions are enabled on.
File
- src/
ScheduledTransitionsUtility.php, line 98
Class
- ScheduledTransitionsUtility
- Utilities for Scheduled Transitions module.
Namespace
Drupal\scheduled_transitionsCode
public function getApplicableBundles() : array {
$bundles = [];
$bundleInfo = $this->bundleInfo
->getAllBundleInfo();
foreach ($bundleInfo as $entityTypeId => $entityTypeBundles) {
$entityType = $this->entityTypeManager
->getDefinition($entityTypeId);
$entityTypeBundles = array_filter($entityTypeBundles, function ($bundleId) use ($entityType) : bool {
return $this->moderationInformation
->shouldModerateEntitiesOfBundle($entityType, $bundleId);
}, \ARRAY_FILTER_USE_KEY);
$bundles[$entityTypeId] = array_keys($entityTypeBundles);
}
return array_filter($bundles);
}