/** * Creates an event type config. * * @param \Drupal\Core\Config\Entity\ConfigEntityInterface * An entity type. * * @return \Drupal\rng\EventTypeInterface * An event type config. */ function createEventType(ConfigEntityInterface $entity_type) { $event_type = EventType::create(['label' => 'Event Type A', 'entity_type' => $entity_type->getEntityType()->getBundleOf(), 'bundle' => $entity_type->id(), 'mirror_operation_to_event_manage' => 'update']); $event_type->save(); \Drupal::service('router.builder')->rebuildIfNeeded(); return $event_type; }