You are here

public function FullCalendar::parseFields in FullCalendar 8

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.2 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::parseFields()
  3. 8.3 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::parseFields()
  4. 8.4 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 237

Class

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

Namespace

Drupal\fullcalendar\Plugin\views\style

Code

public function parseFields($include_gcal = TRUE) {
  $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, $include_gcal)) {
      $date_fields[$id] = $labels[$id];
    }
  }
  return $date_fields;
}