Bundle.php in FullCalendar 8.3
File
fullcalendar_legend/src/Plugin/block/Bundle.php
View source
<?php
namespace Drupal\fullcalendar_legend\Plugin\Block;
class Bundle extends FullcalendarLegendBase {
protected function buildLegend(array $fields) {
$types = [];
foreach ($fields as $field_name => $field) {
foreach ($field['bundles'] as $entity_type => $bundles) {
$bundle_info = entity_get_bundles($entity_type);
foreach ($bundles as $bundle) {
if (!isset($types[$bundle])) {
$types[$bundle]['entity_type'] = $entity_type;
$types[$bundle]['field_name'] = $field_name;
$types[$bundle]['bundle'] = $bundle;
$types[$bundle]['label'] = $bundle_info[$bundle]['label'];
}
}
}
}
return $types;
}
}