You are here

private function SmartDateProcessor::getIdMappings in Smart Date 3.2.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php \Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor::getIdMappings()
  2. 3.x src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php \Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor::getIdMappings()
  3. 3.0.x src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php \Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor::getIdMappings()
  4. 3.1.x src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php \Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor::getIdMappings()
  5. 3.3.x src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php \Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor::getIdMappings()
  6. 3.4.x src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php \Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor::getIdMappings()

Helper function to extract a simple array mapping ids to their array keys.

Parameters

array $entries: The entries as created by Fullcalendar View.

Return value

array An array to map

1 call to SmartDateProcessor::getIdMappings()
SmartDateProcessor::process in src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php
Process retrieved values before being passed to Fullcalendar.

File

src/Plugin/FullcalendarViewProcessor/SmartDateProcessor.php, line 91

Class

SmartDateProcessor
Smart Date plugin.

Namespace

Drupal\smart_date\Plugin\FullcalendarViewProcessor

Code

private function getIdMappings(array $entries) {
  $ids = [];
  foreach ($entries as $key => $entry) {
    $id_parts = explode('-', $entry['id']);
    $label = $entry['eid'] . '-' . $id_parts[1];
    $ids[$label] = $key;
  }
  return $ids;
}