function ModerationStateFilter::onDependencyRemoval
Same name in other branches
- 9 core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php \Drupal\content_moderation\Plugin\views\filter\ModerationStateFilter::onDependencyRemoval()
- 8.9.x core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php \Drupal\content_moderation\Plugin\views\filter\ModerationStateFilter::onDependencyRemoval()
- 10 core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php \Drupal\content_moderation\Plugin\views\filter\ModerationStateFilter::onDependencyRemoval()
Overrides DependentWithRemovalPluginInterface::onDependencyRemoval
File
-
core/
modules/ content_moderation/ src/ Plugin/ views/ filter/ ModerationStateFilter.php, line 220
Class
- ModerationStateFilter
- Provides a filter for the moderation state of an entity.
Namespace
Drupal\content_moderation\Plugin\views\filterCode
public function onDependencyRemoval(array $dependencies) {
// See if this handler is responsible for any of the dependencies being
// removed. If this is the case, indicate that this handler needs to be
// removed from the View.
$remove = FALSE;
// Get all the current dependencies for this handler.
$current_dependencies = $this->calculateDependencies();
foreach ($current_dependencies as $group => $dependency_list) {
// Check if any of the handler dependencies match the dependencies being
// removed.
foreach ($dependency_list as $config_key) {
if (isset($dependencies[$group]) && array_key_exists($config_key, $dependencies[$group])) {
// This handlers dependency matches a dependency being removed,
// indicate that this handler needs to be removed.
$remove = TRUE;
break 2;
}
}
}
return $remove;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.