EntityFormModeAddForm.php in Zircon Profile 8
Same filename and directory in other branches
Namespace
Drupal\field_ui\FormFile
core/modules/field_ui/src/Form/EntityFormModeAddForm.phpView source
<?php
/**
* @file
* Contains \Drupal\field_ui\Form\EntityFormModeAddForm.
*/
namespace Drupal\field_ui\Form;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Provides the add form for entity display modes.
*/
class EntityFormModeAddForm extends EntityDisplayModeAddForm {
/**
* {@inheritdoc}
*/
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);
}
}
Classes
Name | Description |
---|---|
EntityFormModeAddForm | Provides the add form for entity display modes. |