entityTypeManager = $entity_type_manager; } /** *    * {@inheritdoc} *    */ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $base_plugin_id, $container->get('entity_type.manager') ); } /** *    * {@inheritdoc} *    */ public function getDerivativeDefinitions($base_plugin_definition) { $links = []; $eventTypes = $this->entityTypeManager->getStorage('oc_event_type')->loadMultiple(); foreach ($eventTypes as $id => $eventType) { $links[$id] = [ 'title' => \Drupal\opencase\Pluraliser::pluralise($eventType->label()), 'route_name' => "view.events.page_1", 'route_parameters' => ['type' => $eventType->id()] ] + $base_plugin_definition; } return $links; } }