You are here

public function FullCalendar::parseFields in FullCalendar 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::parseFields()
  2. 8 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::parseFields()
  3. 8.2 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::parseFields()
  4. 8.3 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::parseFields()

Extracts date fields from the view.

1 call to FullCalendar::parseFields()
FullCalendar::validate in src/Plugin/views/style/FullCalendar.php
Validate that the plugin is correct and can be saved.

File

src/Plugin/views/style/FullCalendar.php, line 187

Class

FullCalendar
Plugin annotation @ViewsStyle( id = "fullcalendar", title = @Translation("FullCalendar"), help = @Translation("Displays items on a calendar."), theme = "views_view--fullcalendar", display_types = {"normal"} )

Namespace

Drupal\fullcalendar\Plugin\views\style

Code

public function parseFields() {
  $this->view
    ->initHandlers();
  $labels = $this->displayHandler
    ->getFieldLabels();
  $date_fields = [];

  /** @var \Drupal\views\Plugin\views\field\EntityField $field */
  foreach ($this->view->field as $id => $field) {
    if (fullcalendar_field_is_date($field)) {
      $date_fields[$id] = $labels[$id];
    }
  }
  return $date_fields;
}