3 namespace Drupal\field_ui\Form;
5 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
8 * Provides the add form for entity display modes.
10 class EntityFormModeAddForm extends EntityDisplayModeAddForm {
15 protected function prepareEntity() {
16 $definition = $this->entityManager->getDefinition($this->targetEntityTypeId);
17 if (!$definition->get('field_ui_base_route') || !$definition->hasFormClasses()) {
18 throw new NotFoundHttpException();
21 $this->entity->setTargetType($this->targetEntityTypeId);