getMapper example


    ];
  }

  /** * Reacts to the populating of a configuration mapper. * * @param \Drupal\config_translation\Event\ConfigMapperPopulateEvent $event * The configuration mapper event. */
  public function addConfigNames(ConfigMapperPopulateEvent $event) {
    $mapper = $event->getMapper();
    if ($mapper->getBaseRouteName() === 'system.site_information_settings' && $mapper->getLangcode() === 'en') {
      $mapper->addConfigName('config_translation_test.content');
    }
  }

}

    return $events;
  }

  /** * Reacts to the populating of a configuration mapper. * * @param \Drupal\config_translation\Event\ConfigMapperPopulateEvent $event * The configuration mapper event. */
  public function addConfigNames(ConfigMapperPopulateEvent $event) {
    $mapper = $event->getMapper();
    if ($mapper instanceof ConfigEntityMapper && $mapper->getType() == 'filter_format') {
      $editor_config_name = 'editor.editor.' . $mapper->getEntity()->id();
      // Only add the text editor config if it exists, otherwise we assume no       // editor has been set for this text format.       if (!$this->configFactory->get($editor_config_name)->isNew()) {
        $mapper->addConfigName($editor_config_name);
      }
    }
  }

}
Home | Imprint | This part of the site doesn't use cookies.