Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function submitConfigurationForm(array &$form, FormStateInterface $form_state)
 {
     if ($form_state->getValue('aircraft_type') === 'helicopters') {
         drupal_set_message($this->t('Helicopters are just rotorcraft.'), 'warning');
         $form_state->setValue('aircraft_type', 'rotorcraft');
     }
     parent::submitConfigurationForm($form, $form_state);
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function calculateDependencies()
 {
     $this->addDependencies(parent::calculateDependencies());
     $entity_type_id = $this->getConfigurationValue('entity_type');
     $entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
     $this->addDependency('module', $entity_type->getProvider());
     // Calculate bundle dependencies.
     foreach ($this->getConfigurationValue('bundles') as $bundle) {
         $bundle_dependency = $entity_type->getBundleConfigDependency($bundle);
         $this->addDependency($bundle_dependency['type'], $bundle_dependency['name']);
     }
     // Calculate display Entity Embed Display dependencies.
     foreach ($this->getConfigurationValue('display_plugins') as $display_plugin) {
         $instance = $this->displayPluginManager->createInstance($display_plugin);
         $this->calculatePluginDependencies($instance);
     }
     return $this->dependencies;
 }