EntityDisplayModeAddForm::prepareEntity

protected EntityDisplayModeAddForm::prepareEntity()

Prepares the entity object before the form is built first.

Overrides EntityForm::prepareEntity

File

core/modules/field_ui/src/Form/EntityDisplayModeAddForm.php, line 45

Class

EntityDisplayModeAddForm
Provides the add form for entity display modes.

Namespace

Drupal\field_ui\Form

Code

protected function prepareEntity() {
  $definition = $this->entityManager->getDefinition($this->targetEntityTypeId);
  if (!$definition->get('field_ui_base_route') || !$definition->hasViewBuilderClass()) {
    throw new NotFoundHttpException();
  }

  $this->entity->setTargetType($this->targetEntityTypeId);
}
doc_Drupal
2016-10-29 09:05:33
Comments
Leave a Comment

Please login to continue.