You are here

public function GroupType::summary in Organic groups 8

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

Overrides ConditionInterface::summary

File

src/Plugin/Condition/GroupType.php, line 137

Class

GroupType
Provides a 'Group Type' block visibility condition.

Namespace

Drupal\og\Plugin\Condition

Code

public function summary() {
  if (count($this->configuration['group_types']) > 1) {
    $group_types = $this->configuration['group_types'];
    $last_group = array_pop($group_types);
    $group_types = implode(', ', $group_types);
    return $this
      ->t('The group type is @group_types or @last_group', [
      '@group_types' => $group_types,
      '@last_group' => $last_group,
    ]);
  }
  $group_type = reset($this->configuration['group_types']);
  return $this
    ->t('The group type is @group_type', [
    '@group_type' => $group_type,
  ]);
}