Version 1
[yaffs-website] / web / core / modules / node / src / ConfigTranslation / NodeTypeMapper.php
1 <?php
2
3 namespace Drupal\node\ConfigTranslation;
4
5 use Drupal\config_translation\ConfigEntityMapper;
6 use Drupal\Core\Config\Entity\ConfigEntityInterface;
7
8 /**
9  * Provides a configuration mapper for node types.
10  */
11 class NodeTypeMapper extends ConfigEntityMapper {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function setEntity(ConfigEntityInterface $entity) {
17     parent::setEntity($entity);
18
19     // Adds the title label to the translation form.
20     $node_type = $entity->id();
21     $config = $this->configFactory->get("core.base_field_override.node.$node_type.title");
22     if (!$config->isNew()) {
23       $this->addConfigName($config->getName());
24     }
25   }
26
27 }