function EntityBundle::evaluate
Overrides ConditionInterface::evaluate
File
-
core/
lib/ Drupal/ Core/ Entity/ Plugin/ Condition/ EntityBundle.php, line 86
Class
- EntityBundle
- Provides the 'Entity Bundle' condition.
Namespace
Drupal\Core\Entity\Plugin\ConditionCode
public function evaluate() {
// Returns true if no bundles are selected and negate option is disabled.
if (empty($this->configuration['bundles']) && !$this->isNegated()) {
return TRUE;
}
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $this->getContextValue($this->getDerivativeId());
return !empty($this->configuration['bundles'][$entity->bundle()]);
}