ConfigEntityMapper::setType

public ConfigEntityMapper::setType($entity_type)

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.

File

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

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;
}
doc_Drupal
2016-10-29 08:52:49
Comments
Leave a Comment

Please login to continue.