You are here

class NodeTypeMapper in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/src/ConfigTranslation/NodeTypeMapper.php \Drupal\node\ConfigTranslation\NodeTypeMapper
  2. 9 core/modules/node/src/ConfigTranslation/NodeTypeMapper.php \Drupal\node\ConfigTranslation\NodeTypeMapper

Provides a configuration mapper for node types.

Hierarchy

Expanded class hierarchy of NodeTypeMapper

File

core/modules/node/src/ConfigTranslation/NodeTypeMapper.php, line 11

Namespace

Drupal\node\ConfigTranslation
View source
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();
    $config = $this->configFactory
      ->get("core.base_field_override.node.{$node_type}.title");
    if (!$config
      ->isNew()) {
      $this
        ->addConfigName($config
        ->getName());
    }
  }

}

Members