You are here

public function ChildOfMicrosite::summary in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x modules/entity_hierarchy_microsite/src/Plugin/Condition/ChildOfMicrosite.php \Drupal\entity_hierarchy_microsite\Plugin\Condition\ChildOfMicrosite::summary()

Provides a human readable summary of the condition's configuration.

Overrides ConditionInterface::summary

File

modules/entity_hierarchy_microsite/src/Plugin/Condition/ChildOfMicrosite.php, line 40

Class

ChildOfMicrosite
Defines a condition plugin to test if current page is child of microsite.

Namespace

Drupal\entity_hierarchy_microsite\Plugin\Condition

Code

public function summary() {
  $options = $this
    ->getFieldOptions();
  if (empty($this->configuration['field'])) {
    return '';
  }
  return $this
    ->t('@state true if current page is a child of a microsite for the @field field.', [
    '@field' => $options[$this->configuration['field']],
    '@state' => empty($this->configuration['negate']) ? $this
      ->t('Return') : $this
      ->t('Do not return'),
  ]);
}