function NodeType::removeConstraints
Parameters
\Drupal\Core\Plugin\Context\ContextInterface[] $contexts:
Overrides ConstraintConditionInterface::removeConstraints
1 call to NodeType::removeConstraints()
- NodeType::applyConstraints in src/
Plugin/ Condition/ NodeType.php
File
-
src/
Plugin/ Condition/ NodeType.php, line 43
Class
Namespace
Drupal\ctools\Plugin\ConditionCode
public function removeConstraints(array $contexts = []) {
// Reset the bundle constraint for any context we've mapped.
foreach ($this->getContextMapping() as $definition_id => $context_id) {
$constraints = $contexts[$context_id]->getContextDefinition()
->getConstraints();
unset($constraints['Bundle']);
$contexts[$context_id]->getContextDefinition()
->setConstraints($constraints);
}
}