function NodeTypeMapper::setEntity
Same name in other branches
- 9 core/modules/node/src/ConfigTranslation/NodeTypeMapper.php \Drupal\node\ConfigTranslation\NodeTypeMapper::setEntity()
- 8.9.x core/modules/node/src/ConfigTranslation/NodeTypeMapper.php \Drupal\node\ConfigTranslation\NodeTypeMapper::setEntity()
- 11.x core/modules/node/src/ConfigTranslation/NodeTypeMapper.php \Drupal\node\ConfigTranslation\NodeTypeMapper::setEntity()
Overrides ConfigEntityMapper::setEntity
File
-
core/
modules/ node/ src/ ConfigTranslation/ NodeTypeMapper.php, line 16
Class
- NodeTypeMapper
- Provides a configuration mapper for node types.
Namespace
Drupal\node\ConfigTranslationCode
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());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.