Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 6 |
| EntityFormModeAddForm | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 6 |
| prepareEntity | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 6 |
|||
| <?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); | |
| } | |
| } |