function EntityBundle::evaluate
Evaluates the condition and returns TRUE or FALSE accordingly.
Return value
bool TRUE if the condition has been met, FALSE otherwise.
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()]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.