function ConfigFieldMapper::setEntity
Overrides ConfigEntityMapper::setEntity
File
-
core/
modules/ config_translation/ src/ ConfigFieldMapper.php, line 53
Class
- ConfigFieldMapper
- Configuration mapper for fields.
Namespace
Drupal\config_translationCode
public function setEntity(ConfigEntityInterface $entity) {
if (parent::setEntity($entity)) {
// Field storage config can also contain translatable values. Add the name
// of the config as well to the list of configs for this entity.
/** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
$field_storage = $this->entity
->getFieldStorageDefinition();
/** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type_info */
$entity_type_info = $this->entityTypeManager
->getDefinition($field_storage->getEntityTypeId());
$this->addConfigName($entity_type_info->getConfigPrefix() . '.' . $field_storage->id());
return TRUE;
}
return FALSE;
}