function EntityTypeManager::getFormObject
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getFormObject()
- 10 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getFormObject()
- 11.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getFormObject()
Overrides EntityTypeManagerInterface::getFormObject
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php, line 221
Class
- EntityTypeManager
- Manages entity type plugin definitions.
Namespace
Drupal\Core\EntityCode
public function getFormObject($entity_type_id, $operation) {
if (!($class = $this->getDefinition($entity_type_id, TRUE)
->getFormClass($operation))) {
throw new InvalidPluginDefinitionException($entity_type_id, sprintf('The "%s" entity type did not specify a "%s" form class.', $entity_type_id, $operation));
}
$form_object = $this->classResolver
->getInstanceFromDefinition($class);
return $form_object->setStringTranslation($this->stringTranslation)
->setModuleHandler($this->moduleHandler)
->setEntityTypeManager($this)
->setOperation($operation);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.