public function HideNoString::summary in Field Formatter Condition 8
Return the summary string.
Parameters
array $settings: The current settings array.
Overrides FieldFormatterConditionBase::summary
File
- src/
Plugin/ Field/ FieldFormatter/ Condition/ HideNoString.php, line 62
Class
- HideNoString
- The plugin for check empty fields.
Namespace
Drupal\fico\Plugin\Field\FieldFormatter\ConditionCode
public function summary($settings) {
$options = [];
$fields = $this
->getEntityFields($settings['entity_type'], $settings['bundle']);
$allowed_field_types = fico_text_types();
foreach ($fields as $field_name => $field) {
if ($field_name != $settings['field_name'] && in_array($field
->getType(), $allowed_field_types)) {
$options[$field_name] = $field
->label();
}
}
return t('Condition: %condition (%field = "%string")', [
"%condition" => t('Hide when target field does not contain a string'),
'%field' => $options[$settings['settings']['target_field']],
'%string' => $settings['settings']['string'],
]);
}