You are here

public function YaMaps::getFields in Yandex.Maps 8

Returns field names.

Return value

array Fields list.

1 call to YaMaps::getFields()
YaMaps::buildOptionsForm in src/Plugin/views/style/YaMaps.php
Provide a form to edit options for this plugin.

File

src/Plugin/views/style/YaMaps.php, line 544

Class

YaMaps
Allow to display several field items on a yandex map.

Namespace

Drupal\yamaps\Plugin\views\style

Code

public function getFields() {
  $field_names = [
    '' => $this
      ->t('@PLACEMARK_NONE_FIELD', [
      '@PLACEMARK_NONE_FIELD' => static::PLACEMARK_NONE_FIELD,
    ]),
    static::PLACEMARK_DEFAULT_FIELD => $this
      ->t('Default balloon value'),
  ];
  $fields = $this->displayHandler
    ->getHandlers('field');
  foreach ($fields as $id => $handler) {
    if (isset($handler->human_name)) {
      $field_names[$id] = $handler->human_name;
    }
    else {
      $field_names[$id] = $handler->definition['title'];
    }
  }
  return $field_names;
}