function EntityBundle::summary
Provides a human readable summary of the condition's configuration.
Overrides ConditionInterface::summary
File
- 
              core/
lib/ Drupal/ Core/ Entity/ Plugin/ Condition/ EntityBundle.php, line 99  
Class
- EntityBundle
 - Provides the 'Entity Bundle' condition.
 
Namespace
Drupal\Core\Entity\Plugin\ConditionCode
public function summary() {
  if (count($this->configuration['bundles']) > 1) {
    $bundles = $this->configuration['bundles'];
    $last = array_pop($bundles);
    $bundles = implode(', ', $bundles);
    if (empty($this->configuration['negate'])) {
      return $this->t('@bundle_type is @bundles or @last', [
        '@bundle_type' => $this->pluginDefinition['label'],
        '@bundles' => $bundles,
        '@last' => $last,
      ]);
    }
    else {
      return $this->t('@bundle_type is not @bundles or @last', [
        '@bundle_type' => $this->pluginDefinition['label'],
        '@bundles' => $bundles,
        '@last' => $last,
      ]);
    }
  }
  $bundle = reset($this->configuration['bundles']);
  if (empty($this->configuration['negate'])) {
    return $this->t('@bundle_type is @bundle', [
      '@bundle_type' => $this->pluginDefinition['label'],
      '@bundle' => $bundle,
    ]);
  }
  else {
    return $this->t('@bundle_type is not @bundle', [
      '@bundle_type' => $this->pluginDefinition['label'],
      '@bundle' => $bundle,
    ]);
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.