You are here

public function ConfigEntityMapper::setType in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config_translation/src/ConfigEntityMapper.php \Drupal\config_translation\ConfigEntityMapper::setType()
  2. 10 core/modules/config_translation/src/ConfigEntityMapper.php \Drupal\config_translation\ConfigEntityMapper::setType()

Set entity type for this mapper.

This should be set in initialization. A mapper that knows its type but not yet its names is still useful for router item and tab generation. The concrete entity only turns out later with actual controller invocations, when the setEntity() method is invoked before the rest of the methods are used.

Parameters

string $entity_type: The entity type to set.

Return value

bool TRUE if the entity type was set correctly; FALSE otherwise.

1 call to ConfigEntityMapper::setType()
ConfigEntityMapper::__construct in core/modules/config_translation/src/ConfigEntityMapper.php
Constructs a ConfigEntityMapper.

File

core/modules/config_translation/src/ConfigEntityMapper.php, line 190

Class

ConfigEntityMapper
Configuration mapper for configuration entities.

Namespace

Drupal\config_translation

Code

public function setType($entity_type) {
  if (isset($this->entityType)) {
    return FALSE;
  }
  $this->entityType = $entity_type;
  return TRUE;
}