You are here

public function ConfigPagesValueAccess::summary in Config Pages 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/Condition/ConfigPagesValueAccess.php \Drupal\config_pages\Plugin\Condition\ConfigPagesValueAccess::summary()

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

Overrides ConditionInterface::summary

File

src/Plugin/Condition/ConfigPagesValueAccess.php, line 211

Class

ConfigPagesValueAccess
Provides a 'Access by ConfigPage field value' condition.

Namespace

Drupal\config_pages\Plugin\Condition

Code

public function summary() {
  $config_page_field = $this->configuration['config_page_field'];
  $condition_value = $this->configuration['condition_value'];
  $operator = $this->configuration['operator'];
  $operators_list = $this
    ->getOperandOptions();
  list($cp_type, $field, $data_type) = explode('|', $config_page_field);
  $summary = $this
    ->t('Allow if field @field @op @value', [
    '@field' => $field,
    '@op' => strtolower($operators_list[$operator]),
    '@value' => $condition_value,
  ]);
  return $summary;
}