NodeTypeMapper.php 633 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<?php

/**
 * @file
 * Contains \Drupal\node\ConfigTranslation\NodeTypeMapper.
 */

namespace Drupal\node\ConfigTranslation;

use Drupal\config_translation\ConfigEntityMapper;
use Drupal\Core\Config\Entity\ConfigEntityInterface;

/**
 * Provides a configuration mapper for node types.
 */
class NodeTypeMapper extends ConfigEntityMapper {

  /**
   * {@inheritdoc}
   */
  public function setEntity(ConfigEntityInterface $entity) {
    parent::setEntity($entity);

    // Adds the title label to the translation form.
    $node_type = $entity->id();
    $this->addConfigName("core.base_field_override.node.$node_type.title");
  }

}