protected function EntityFormModeAddForm::prepareEntity in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field_ui/src/Form/EntityFormModeAddForm.php \Drupal\field_ui\Form\EntityFormModeAddForm::prepareEntity()
Prepares the entity object before the form is built first.
Overrides EntityDisplayModeAddForm::prepareEntity
File
- core/
modules/ field_ui/ src/ Form/ EntityFormModeAddForm.php, line 20 - Contains \Drupal\field_ui\Form\EntityFormModeAddForm.
Class
- EntityFormModeAddForm
- Provides the add form for entity display modes.
Namespace
Drupal\field_ui\FormCode
protected function prepareEntity() {
$definition = $this->entityManager
->getDefinition($this->targetEntityTypeId);
if (!$definition
->get('field_ui_base_route') || !$definition
->hasFormClasses()) {
throw new NotFoundHttpException();
}
$this->entity
->setTargetType($this->targetEntityTypeId);
}